Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop Until Last Worksheet in Workbook
Hi,
As part of a more complex script, I want this loop to do a set of actions and then move to the next sheet and preform the same set of actions and then stop on the last sheet. Here is what I have so far: Sub Test ActiveSheet.Next.Select Do <my series of code is here ActiveSheet.Next.Select Loop End Sub It is working so far, but when I get to the end an error pops up. Not a big deal, just don't want to have it. Thanks in advance for your help, Derrick |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop Until Last Worksheet in Workbook
Sub Test
ActiveSheet.Next.Select Do <my series of code is here if ActiveSheet.Index < Sheets.count then ActiveSheet.Next.Select else exit do End if Loop End Sub " wrote: Hi, As part of a more complex script, I want this loop to do a set of actions and then move to the next sheet and preform the same set of actions and then stop on the last sheet. Here is what I have so far: Sub Test ActiveSheet.Next.Select Do <my series of code is here ActiveSheet.Next.Select Loop End Sub It is working so far, but when I get to the end an error pops up. Not a big deal, just don't want to have it. Thanks in advance for your help, Derrick |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop Until Last Worksheet in Workbook
Thanks so much.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Loop worksheets workbook | Excel Programming | |||
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook | Excel Programming | |||
Worksheet loop won't loop | Excel Programming | |||
Workbook Loop Headache | Excel Programming | |||
How? Macro to copy range to new worksheet, name new worksheet, loop | Excel Programming |