LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default VBA: Activate sheets within a loop

I want to loop through a list of sheets, why won't the following code allow
me to activate a sheet? Thanks for your help in advance!

Sub LoopThroughSheets()

Dim wSheet As Worksheet

i = 5
wSheet = Sheets("Print Tracks").Range("G" & i).Value

Do While wSheet < ""

Sheets(wSheet).Activate
Calculate

i = i + 1
wSheet = Sheets("Print Tracks").Range("G" & i).Value

Loop

End Sub
 
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
Loop to Filter, Name Sheets. If Blank, Exit Loop ryguy7272 Excel Programming 3 February 5th 08 03:41 PM
visual basic - select/activate but don't show sheets Donna Edwards Excel Programming 1 November 11th 07 05:44 PM
Activate Sheet Best Practice (Y/N?) when xFer data between sheets? [email protected] Excel Programming 2 July 3rd 07 04:52 PM
Activate all sheets George Gee New Users to Excel 10 December 3rd 05 10:00 PM
Any difference between Sheets Activate and Select? Don Wiss Excel Programming 1 October 28th 03 12:46 AM


All times are GMT +1. The time now is 09:41 PM.

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"