Microsoft Office Tutorials and References
In Depth Information
Limiting the Calculations
The Calculate method can also be used on Worksheet and Range objects, and it allows you
to narrow down the number of calculations that are performed. Using a Worksheet object
will perform all needed calculations on the specified worksheet. The following example cal
culates the active sheet:
If Application.Calculation <> xlCalculationAutomatic Then
To calculate a limited number of cells, use a Range object to specify the cells you want to
recalculate. This example recalculates the formulas for all cells in the range C1:G13:
CalculateFull forces all open workbooks to recalculate all cells regardless of the contents. The
following example recalculates all open workbooks:
The FindFile method displays the Open dialog box and opens the file selected by the user. It
returns a Tr ue value if a file was successfully opened or a False if the user clicked the Cancel
button. The following example prompts the user to locate the ProductList.xls file:
Dim bReturn As Boolean, strPrompt As String
strPrompt = "Please locate the ProductList.xls file."
MsgBox strPrompt, vbOKOnly + vbInformation, " Microsoft Office Excel 2003 _
Programming Inside Out"
bReturn = Application.FindFile
If Not bReturn Then
strPrompt = "File not opened."