Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,069
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
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
Macro to paste worksheets in another workbook [email protected] Excel Discussion (Misc queries) 0 March 28th 07 02:13 PM
Running Same macro in 250 Worksheets in Same Workbook halem2 Excel Worksheet Functions 3 March 24th 06 08:51 AM
automatically apply a macro to all worksheets minrufeng Excel Discussion (Misc queries) 5 February 21st 06 09:34 PM
Excel should apply names in all worksheets of a workbook Softball Pete Excel Discussion (Misc queries) 1 January 23rd 06 02:42 PM
Applying same macro to all worksheets in workbook [email protected] Excel Discussion (Misc queries) 2 October 19th 05 11:25 PM


All times are GMT +1. The time now is 02:40 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"