Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default using array with Windows().activate

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

--
Regards,
Tom Ogilvy



"NikkoW" wrote in message
t.cable.rogers.com...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot open exel from windows xp in windows vista and visa versa lildiana New Users to Excel 4 February 25th 09 07:26 PM
can windows vista edit shared document from windows xp sasa Excel Worksheet Functions 1 January 9th 08 06:44 PM
Page breaks are different in Windows 2000 and Windows XP Bill Allen Excel Discussion (Misc queries) 1 November 23rd 05 04:42 PM
How to activate array formulas in a range of cells all at the same time? Karenna Excel Programming 3 February 29th 04 11:30 PM
Use Array to activate workbooks Stuart[_5_] Excel Programming 3 December 2nd 03 08:17 PM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"