Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Switching to different worksheets during a macro
Each worksheet in your workbook belong to a worksheets collection. You can
step through each member (worksheet) of a collection without reference to the name. See collections in the help file. Incidently, many other collections are used by Excel as well. Having a good understanding of this will be very beneficial. Also, it is 'generally' better coding practice to use the select and activate methods, judiciously. You can always create references to workbooks, worksheets, ranges, etc., without having to select/activate them. Bill Barclift "Michelle72" wrote in message ... I have a workbook with 10 worksheets in it. The first sheet is a data entry page and upon filling in all necessary cells, I click on a button for a macro I have created that runs a series of macros on all sheets. This macro consists of several other macros...for example, it selects the next sheet and performs a macro then selects the next sheet and performs a macro and so on until it has run each macro on the 9 sheets(one on each sheet). Currently, in the large macro on the 1st sheet it selects the next sheet as follows: Sheets("name of sheet").Select Is there anyway to tell it to select the next worksheet without having to actually have the name of the sheet in there? In the future, I will be adding and deleting worksheets as my customer base changes and it would be great to have a "generic select the next sheet until there aren't anymore code" and it would allow me to not have to edit my macro(s) everytime that happens Any help would be greatly appreciated! Thanks, Michelle :) ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatically switching between worksheets. | Excel Discussion (Misc queries) | |||
keyboard shortcut for switching between worksheets?? | Excel Worksheet Functions | |||
Short cut for switching between worksheets | Excel Worksheet Functions | |||
Macro error after switching from Excel 2000 to Excel 2003 | Excel Discussion (Misc queries) | |||
What is the shortcut for switching between worksheets? | Excel Discussion (Misc queries) |