Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
2003
With in the following loop: For Each wks In Worksheets (I am trying to increment to "Next" wks in Worksheets if any sheets listed in the array occur) If wks.name = Array("Do not process1","Do not process2", _ "Do not process3") Then _ Next wks Next wks I do not think that I can wks = wks +1 as wks is not numeric Also, I may not be handling the array properly. How can I have the For ... Next loop skip all worksheets named as in the array? Thanks EagleOne |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
dim wks as worksheet
for each wks in activeworkbook.worksheets select case lcase(wks.name) case is = "sheet1", "sheet3", "sheet9", "sheet11" 'do nothing case else 'do your work here end select next wks ===== or... dim wksNamesToAvoid as Variant dim wks as worksheet wksnamestoavoid = array("sheet1", "sheet3", "sheet9", "sheet11") for each wks in activeworkbook.worksheets if isnumeric(application.match(wks.name,wksnamestoavo id,0)) then 'do nothing else 'do your work here end if next wks You don't want to change the worksheet in your loop--just don't do anything if that name matches your list. EagleOne wrote: 2003 With in the following loop: For Each wks In Worksheets (I am trying to increment to "Next" wks in Worksheets if any sheets listed in the array occur) If wks.name = Array("Do not process1","Do not process2", _ "Do not process3") Then _ Next wks Next wks I do not think that I can wks = wks +1 as wks is not numeric Also, I may not be handling the array properly. How can I have the For ... Next loop skip all worksheets named as in the array? Thanks EagleOne -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
'Scroll bar' - to increment btwn MIN and MAX value. | Charts and Charting in Excel | |||
Loop time seems dependent on unrelated workbook - Why? | Excel Worksheet Functions | |||
Loop gone crazy | Excel Discussion (Misc queries) | |||
Do Loop | Excel Discussion (Misc queries) | |||
Relative reference autofill increment other than +1 | Excel Discussion (Misc queries) |