Microsoft Office Tutorials and References
In Depth Information
Next intLoop
sglEnd = Timer
Debug.Print sglEnd
strPrompt = "Processing time range method: " & _
Format(sglEnd - sglStart, "#0.00000") & _
" Total Cells:" & Str$(intCount) & vbCrLf
sglStart = Timer
intCount = 0
For intLoop = 1 To 50
varCells = Range("JanuaryAllValues")
For intRows = 1 To UBound(varCells)
For intColumns = 1 To UBound(varCells, 2)
intCount = intCount + 1
Next intColumns
Next intRows
Next intLoop
sglEnd = Timer
strPrompt = strPrompt & "Processing time array method: " & _
Format(sglEnd - sglStart, "#0.00000") & _
" Total Cells:" & Str$(intCount)
MsgBox strPrompt, vbOKOnly + vbInformation, strTitle
End Sub
Getting Data Entry Right the First Time
Typing data into a worksheet or form is one of the most tedious activities known to
humanity. If you’ve ever typed ISBNs into a database eight hours a day and five days a week for two
months, you can begin to gt an appreciation for what data entry clerks go though. Columns
of numbers transpose in front of your eyes, books you’ve already entered find their way onto
your “to do” pile, and you change hands to avoid the worst effects of repetitive stress
disorders. Add in the potential for typographical errors, and you can understand why electronic
data collections are so notoriously inaccurate.
You can help catch data entry errors at the source by setting validation rules for cells in your
worksheets. As the name implies, a validation rule is a criterion that cell data must meet in
order to ensue that only meaningful information is added to our data collection. You get to
choose whether the invalid data is accepted as input or whether the user has to re-type the
to o n to he
to llow
entering data to leave cells blank.
The key to creating validation rules for your cells is, as you probably guessed, the Range
object’s Va lidation property. The Va lidation property, which returns a Va lidation object, gives
you the tools to set the validation rules and notification styles for your cell ranges. Table 8-4
lists the Va lidation object’s useful properties and methods.
Search JabSto ::

Custom Search