This converts the name of an object to its actual value.
Using Application.Evaluate is identical to using [square brackets] around your argument.
The only reason people use the square brackets is that it is shorter
The advantage of using the Evaluate function is that the argument is a string so it is possible to construct the string from code.
This function can be used with the following different types of objects.
A1 style cell references. All references are considered to be absolute.
Ranges. Including union and interset operators (colon, space and comma)
External cell references in other worksheets or workbooks
Chart object names such as "Legend", "Plot Area", "Series 1" to access the corresponding properties and methods.
Application.Evaluate ("A1").Value = 10
[A1].Value = 10
sngVariable = Application.Evaluate["Sin(40)"]
sngVariable = [Sin(40)]
rgeCell = Workbooks("Book1").Sheets(2).[A1]
Charts("Char1").Evaluate("Legend").Font.Name = "Arial"
This cannot evaluate analysis toolpak function unless the Analysis Toolpak-VBA is installed.
The method Application.Evaluate does not exist in Word at the moment
The method Application.Evaluate does not exist in PowerPoint at the moment
© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext