View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Best position in VBA code line for

First, both lines should start with "Set"

Second, the bottom one could fail depending on where those hidden cells are.

wrote:

2003/2007

Both lines do not fail:

myRange = wks.Range("A2:F100").Resize(, 1).SpecialCells(xlCellTypeVisible)

-OR-

myRange = wks.Range("A2:F100").SpecialCells(xlCellTypeVisibl e).Resize(, 1)

Which is best and a little bit as to why

TIA EagleOne


--

Dave Peterson