April 2006
Beginner
1114 pages
98h 16m
English
[Application.]Evaluate(Name)
Evaluates an expression and returns the result. Evaluate is equivalent to enclosing the expression in square brackets ([ ]).
|
Argument |
Setting |
|---|---|
|
|
A range address, a named range, or a formula |
It is common to use the bracket notation for the Evaluate method since it is shorter. The following code displays various values from the active sheet:
Sub TestEvaluate( )
' Show value of cell A1.
Debug.Print [a1]
' Show total of A1:A3.
Debug.Print [sum(a1:a3)]
' Show table of named ranges
Dim n As Name, str As String
Debug.Print "Name", "# w/data", "Address"
For Each n In Names
str = "Count(" & n.Name & ")"
Debug.Print n.Name, Evaluate(str), [n]
Next
End SubUsing the bracket notation with a Name object returns the address of the name.
Read now
Unlock full access