Topic:Excel VBA Numeric Sheet access Remainpoint:0
   
PostTime:12/16/2008 4:50:13 PM FloorTop
Lv is 1
Avatar
Level:
1
Professional point:
78
Experience:
9
Thread:
286
Post:
947
Total online time:
9M
Joined date:
4/29/2007 12:17:00 AM
Last Visit:
12/16/2008 11:26:07 PM
Status:
Offline
I have a range of sheets 1 to 10. The sheets are named 0 to 9. I need to access the sheets in a loop, eg.

For i = 0 to 9
Sheets(i1).Activate
Next i

Unfortunately if i=0 this tries access the sheet number 0, not the sheet named 0.

However, if I use the code
Sheets("0").Activate
It's fine, but it's not in the loop.

To make matters worse, this is an abridged example, what I actually have is 210 sheets of which 200 are named 0 to 199.

Can any experts out there figure out how to get the correct named sheet without renaming them all?
 
     
   
Gender PostTime:12/16/2008 7:05:04 PM Point:0 | Floor# 1
Lv is 1
portrait
Level:
1
Professional point:
96
Experience:
6
Thread:
271
Post:
1040
Total online time:
6M
Joined date:
4/28/2007 11:55:00 PM
Last Visit:
12/16/2008 11:36:22 PM
Status:
Offline
Check out the Cstr() function.
 
     
1

Sorry, you are not login, click here to login

 

About us | Advertise | Contact us | Partner | Bug Report|Suggesting box|Donation
Home | Forum | Affiliate program| Remote help | Setting | Search | Document | Help | Download|Message

 

Start new topicAdvanced search