Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically switching between worksheets. dinouk Excel Discussion (Misc queries) 3 December 6th 06 10:08 PM
keyboard shortcut for switching between worksheets?? BC022841 Excel Worksheet Functions 2 October 17th 06 08:56 PM
Short cut for switching between worksheets Paul Gignac Excel Worksheet Functions 2 March 22nd 06 07:37 PM
Macro error after switching from Excel 2000 to Excel 2003 Jake Burnham Excel Discussion (Misc queries) 1 January 10th 06 08:10 PM
What is the shortcut for switching between worksheets? DJALik Excel Discussion (Misc queries) 1 September 15th 05 04:55 PM


All times are GMT +1. The time now is 03:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"