Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is there a way to do the For Each sheet and exclude sheets to have it
done to at the same time? Thanks, Jay |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
dim wks as worksheet
for each wks in activeworkbook.worksheets select case lcase(wks.name) case is = "not this one", "or this one", "and not this" 'do nothing case else 'do the real work msgbox wks.name end select next wks Make sure you type the names of the worksheets in lower case. jlclyde wrote: Is there a way to do the For Each sheet and exclude sheets to have it done to at the same time? Thanks, Jay -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Nov 6, 1:34*pm, Dave Peterson wrote:
dim wks as worksheet for each wks in activeworkbook.worksheets * *select case lcase(wks.name) * * * *case is = "not this one", "or this one", "and not this" * * * * * 'do nothing * * * *case else * * * * * 'do the real work * * * * * msgbox wks.name * *end select next wks Make sure you type the names of the worksheets in lower case. jlclyde wrote: Is there a way to do the For Each sheet and exclude sheets to have it done to at the same time? Thanks, Jay -- Dave Peterson Dave, You have been saving my butt left and right. Thanks again. Jay |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
for each ws in worksheets
if ws.name<"name you want to exclude" then 'do what you want to do end if next "jlclyde" wrote: Is there a way to do the For Each sheet and exclude sheets to have it done to at the same time? Thanks, Jay |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub test()
exclude = Array("A", "B", "C") For Each sht In Sheets Found = False For Each itm In exclude If UCase(sht.Name) = UCase(tim) Then Found = True Exit For End If If Found = False Then 'enter you code here End If Next itm Next sht End Sub "jlclyde" wrote: Is there a way to do the For Each sheet and exclude sheets to have it done to at the same time? Thanks, Jay |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Duplicate sheet, autonumber sheet, record data on another sheet | Excel Worksheet Functions | |||
lookup single value in one sheet, return multiple results from theother sheet | Excel Worksheet Functions | |||
"='sheet 1'!D4" auto fill sheet to sheet ='sheet 2'!D4 | Excel Worksheet Functions | |||
How do I select price from sheet.b where sheet.a part no = sheet.b | Excel Worksheet Functions | |||
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. | Excel Discussion (Misc queries) |