View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default best practices question

Hi Gary,

The preferred With statement would be the one that eliminates the most dots.
So "With Workbooks(1).Range("A1").Interior" would be more efficient than
"With Workbooks(2).Range("A1")".
However, you also need to determine the number of times each "With" statement
is referenced.
For instance, if a With statement wraps code inside a loop, then that one would
usually be the most efficient. (assuming that "dots" are actually eliminated)

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
what's the preferred way to do this?
let's say there's a master workbook and child workbooks. the procedure is to
load and copy child data to the master which is already loaded.

when you use the with workbook statement, is it preferred to use:

with workbooks("master")

or

with workbooks("child")

or does it matter?

just wondering
Gary