View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NikkoW NikkoW is offline
external usenet poster
 
Posts: 9
Default using array with Windows().activate

If it isn't one thing its another. This generates type mismatch error on the
last line. Am I doing something stupid again or, if I can't do it this way,
can someone suggest a better way? Thanks!

Sub ImaNoob()
Dim MyFiles, I As Variant
MyFiles = Array("Con.xls", "CAN1a.xls", _
"CAN1b.xls", "CAN1c.xls")
For Each I In MyFiles
Application.Windows(MyFiles(I)).Activate
....do some stuff
Next I
End Sub