Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following worked for me, maybe this example is a step
in the direction you want to go. Before trying this, insert sheets until you have 10 on a new workbook: Private Sub tester() For i = 1 To 10 sheetname = "sheet" & i Sheets(sheetname).Activate Next i End Sub This code successfully cycles through all 10 sheets. Now just modify it for whatever you are doing. -IA -----Original Message----- I want to call an object by its codename with a variable, rather than by the object group the variable name It would take way too much time and typing to explain why I want to do it this way....But the main one is; I want to be able to pull up the right sheet no matter what the user renames the sheet to. And yes...I do want to allow the user to do this. for example... for i = 1 to 10 sheetname = "sheet" & i thisworkbook.sheetname.blah.blah <do this next i of course, this method will not work...but has anybody a way to accomplish the same task, but in a different strategy? Much appreciated ricky . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error '91' Object variable or With block variable not set | Excel Discussion (Misc queries) | |||
Object Variable Not Set Error on Selection object | Excel Worksheet Functions | |||
object variable or with block variable not set | Excel Discussion (Misc queries) | |||
Error 91 - Object variable with block variable not set | Excel Programming | |||
Object Variable or With Block variable not set? | Excel Programming |