Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Apply Macro to all worksheets in a workbook except one
Is there a way to include an exception to this macro so that it excludes
Sheet1?? Sub Apply_to_all_sheets() For Each ws In Worksheets Call Begin Next End Sub Thanks for any help Carrie -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200901/1 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Apply Macro to all worksheets in a workbook except one
Sub Apply_to_all_sheets()
Dim ws As Worksheet For Each ws In Worksheets If ws.Name = "Sheet1" Then Else Call begin End If Next End Sub -- Gary''s Student - gsnu2007k "Carrie_Loos via OfficeKB.com" wrote: Is there a way to include an exception to this macro so that it excludes Sheet1?? Sub Apply_to_all_sheets() For Each ws In Worksheets Call Begin Next End Sub Thanks for any help Carrie -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200901/1 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Apply Macro to all worksheets in a workbook except one
Sub Apply_to_all_sheets()
For Each ws In Worksheets If ws.name = "Sheet1" then goto xSkip Call Begin xSkip: Next End Sub -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Carrie_Loos via OfficeKB.com" wrote: Is there a way to include an exception to this macro so that it excludes Sheet1?? Sub Apply_to_all_sheets() For Each ws In Worksheets Call Begin Next End Sub Thanks for any help Carrie -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200901/1 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Apply Macro to all worksheets in a workbook except one
Hi,
Sub Apply_to_all_sheets() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets If ws.Name < "Sheet1" Then Call begin End If Next End Sub Mike "Carrie_Loos via OfficeKB.com" wrote: Is there a way to include an exception to this macro so that it excludes Sheet1?? Sub Apply_to_all_sheets() For Each ws In Worksheets Call Begin Next End Sub Thanks for any help Carrie -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200901/1 |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Apply Macro to all worksheets in a workbook except one
Try
For Each ws In Worksheets If ws.Name < "Sheet1" Then Call Begin End If Next Hope this helps, Hutch "Carrie_Loos via OfficeKB.com" wrote: Is there a way to include an exception to this macro so that it excludes Sheet1?? Sub Apply_to_all_sheets() For Each ws In Worksheets Call Begin Next End Sub Thanks for any help Carrie -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200901/1 |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Apply Macro to all worksheets in a workbook except one
Sometimes, it's better to ignore upper/lowercase, too:
Option Explicit Sub Apply_to_all_sheets() dim ws as worksheet For Each ws In Worksheets if lcase(ws.name) < lcase("Sheet1") then Call Begin end if Next ws End Sub And if you ever have to add a few more sheet names, you may want to look at "Select case" Option Explicit Sub Apply_to_all_sheets2() dim ws as worksheet For Each ws In Worksheets select case lcase(ws.name) case is = lcase("sheet1"), lcase("sheet99"), lcase("sheet33") 'do nothing case else Call Begin end select Next ws End Sub "Carrie_Loos via OfficeKB.com" wrote: Is there a way to include an exception to this macro so that it excludes Sheet1?? Sub Apply_to_all_sheets() For Each ws In Worksheets Call Begin Next End Sub Thanks for any help Carrie -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200901/1 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to paste worksheets in another workbook | Excel Discussion (Misc queries) | |||
Running Same macro in 250 Worksheets in Same Workbook | Excel Worksheet Functions | |||
automatically apply a macro to all worksheets | Excel Discussion (Misc queries) | |||
Excel should apply names in all worksheets of a workbook | Excel Discussion (Misc queries) | |||
Applying same macro to all worksheets in workbook | Excel Discussion (Misc queries) |