Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do make a macro activate the next sheet?
I have a macro that i want to run in many files that have the same structure but diferent number of sheets. I can only change sheets by writing: Sheets("Sheet1").Activate I would like to know if there is a command that would work, something like: ActiveSheet.Activatenext (I tried this and didn't work) Can someone tell me how to do this? -- pauloreiss ------------------------------------------------------------------------ pauloreiss's Profile: http://www.excelforum.com/member.php...o&userid=29820 View this thread: http://www.excelforum.com/showthread...hreadid=497860 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do make a macro activate the next sheet?
Almost got it.
activesheet.next.activate -- HTH Bob Phillips (remove nothere from email address if mailing direct) "pauloreiss" wrote in message ... I have a macro that i want to run in many files that have the same structure but diferent number of sheets. I can only change sheets by writing: Sheets("Sheet1").Activate I would like to know if there is a command that would work, something like: ActiveSheet.Activatenext (I tried this and didn't work) Can someone tell me how to do this? -- pauloreiss ------------------------------------------------------------------------ pauloreiss's Profile: http://www.excelforum.com/member.php...o&userid=29820 View this thread: http://www.excelforum.com/showthread...hreadid=497860 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do make a macro activate the next sheet?
Hi Paul,
Try: '============= Public Sub Tester01() Sub TestA() With ActiveSheet If .Index < Sheets.Count Then .Next.Activate Else Sheets(1).Activate End If End With End Sub '<<============= --- Regards, Norman "pauloreiss" wrote in message ... I have a macro that i want to run in many files that have the same structure but diferent number of sheets. I can only change sheets by writing: Sheets("Sheet1").Activate I would like to know if there is a command that would work, something like: ActiveSheet.Activatenext (I tried this and didn't work) Can someone tell me how to do this? -- pauloreiss ------------------------------------------------------------------------ pauloreiss's Profile: http://www.excelforum.com/member.php...o&userid=29820 View this thread: http://www.excelforum.com/showthread...hreadid=497860 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Activate Sheet After Move Macro | Excel Discussion (Misc queries) | |||
how would activate the previous sheet in macro | Excel Discussion (Misc queries) | |||
Return to Current Sheet in On (sheet activate) event macro | Excel Programming | |||
Activate Macro on Activating a sheet | Excel Programming | |||
macro to make different tabs in a same sheet | Excel Programming |