Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This has got to be one of the easiest questions ever asked. I'm trying to add a loop ( a For each loop) to a macro that will perform the macro on all but one worksheet in the current workbook. The only worksheet that I do not what it to run on will always have the same name, but the sheets that I want the macro to run on will not always be the same. Can anyone help? Thanks. Aaron *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Aaron,
Try some code like the following: Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(WS.Name, "do_not_process") < 0 Then ' do something with WS End If Next WS This will do something with every worksheet except the one named "do_not_process". -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Aaron Cooper" wrote in message ... This has got to be one of the easiest questions ever asked. I'm trying to add a loop ( a For each loop) to a macro that will perform the macro on all but one worksheet in the current workbook. The only worksheet that I do not what it to run on will always have the same name, but the sheets that I want the macro to run on will not always be the same. Can anyone help? Thanks. Aaron *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For i = 1 to sheets.count
if worksheets(i).name < "YourSheetNameToExclude" then 'run your macro...which must refer to worksheets(i) end if next On 4/16/04 10:57, in article , "Aaron Cooper" wrote: This has got to be one of the easiest questions ever asked. I'm trying to add a loop ( a For each loop) to a macro that will perform the macro on all but one worksheet in the current workbook. The only worksheet that I do not what it to run on will always have the same name, but the sheets that I want the macro to run on will not always be the same. Can anyone help? Thanks. Aaron *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
Make it more simple or intuitive to do simple things | Charts and Charting in Excel | |||
simple question, hopefully a simple answer! | Excel Programming |