Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
One more question about this if you dont mind. I've modified your macro slighly to have it adjust to the number of sheets to be activated. I used the following macro: Dim rng as Range, cell as Range Dim sh as Worksheet with worksheets("sheet1") set rng = .Range(cell(2,1),cell(2,1).offset(15,0)) End With for each cell in rng set sh = worksheets(cell.value) sh.Activate msgbox "Look at sheet " & sh.Name Next This formula, for some reason, generates run-time error 91, " object variable or with block variable not set." Would you happen to know why this error is occuring and how can I correct it? "Tom Ogilvy" wrote: Dim rng as Range, cell as Range Dim sh as Worksheet with worksheets("sheet1") set rng = .Range("A1:A10") End With for each cell in rng set sh = worksheets(cell.value) sh.Activate msgbox "Look at sheet " & sh.Name Next -- Regards, Tom Ogilvy "Magnivy" wrote: Hey There, I have a workbook with numerous worksheets. One of the worksheets, say Sheet1, lists the names of the other worksheets, say Sheet2 through Sheet 10,in cells A2 through A10. Each cell contains the name of only one worksheet. I am trying to create a macro that would read the name of Sheets2 from cell A2, select it, perform an operation on it (which I already have), select Sheet3 from Cell A3, perform an operation on it, and so on till the operation is performed on Sheet10. I havent been able to come up with a macro that would work. Any help you provide would be greatly appreciated! Sincerely, Magnivy! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with activating previous sheet | Excel Programming | |||
List box not activating | Excel Discussion (Misc queries) | |||
autorun upon activating a sheet | Excel Programming | |||
autorun upon activating a sheet | Excel Programming | |||
Problem in activating a sheet | Excel Programming |