View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Array code troubles

For clarity...

[A]
MyArr contains sheetnames: The With block requires a fully qualified
ref to an object...

With Sheets(MyArr(i))

...otherwise your code implicitly refs the active sheet.

[b]
Setting a ref to an object requires its properties be ref'd via a
'dot'...

With Sheets(MyArr(i))
.Cells...

-OR-

With Sheets(MyArr(i)).Cells
.Find...

...since what you're actually doing is searching the Cells collection of
each sheet.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion