View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_5_] GS[_5_] is offline
external usenet poster
 
Posts: 226
Default Square brackets to specify a range

IanC formulated the question :
In a recent response to another query, the solution featured square brackets.
Wishing to understand more, I delved into the VBA Help file to find that it
equates to "Evaluate" and suggested that a range could be referred to as [A1]
instead of Range("A1").

In a workbook with many instances of Range statements, substituting square
brackets will significantly reduce the number of characters in the code (and
therefore the file size), but is there a downside to this. Does the method
use more resources, or take longer to run?

Many thanks

--
Ian


The downside is that VBA has to analize what's between the brackets in
order to "evaluate" the value. Specifying Range("A1") is faster and
uses less resources at runtime.<IMO<g

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc