Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello - I am using the following script to set print areas and run a macro fo many worksheets at once. Works great, except that I really need t exclude about 5 worksheets from a 100 sheet workbook when using th function. Any suggestions would be appreciated! Sub SetRange() For Each UsrSht In ActiveWorkbook.Worksheets UsrSht.PageSetup.PrintArea = "$A$1:$F$30" Next UsrSht End Sub thanks, Annabe -- annabe ----------------------------------------------------------------------- annabel's Profile: http://www.excelforum.com/member.php...fo&userid=2652 View this thread: http://www.excelforum.com/showthread.php?threadid=44141 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub SetRange()
Dim UsrSht as Worksheet Dim sName as String For Each UsrSht In ActiveWorkbook.Worksheets sName = lcase(UsrSht.Name) if sName < "sheet1" and sName < "sheet5" and _ sName < "sheet10" and sName < "sheet15" and _ sName < "summary" then UsrSht.PageSetup.PrintArea = "$A$1:$F$30" end if Next UsrSht End Sub make sure the sheet names you check against are lower case as shown. -- Regards, Tom Ogilvy "annabel" wrote in message ... Hello - I am using the following script to set print areas and run a macro for many worksheets at once. Works great, except that I really need to exclude about 5 worksheets from a 100 sheet workbook when using the function. Any suggestions would be appreciated! Sub SetRange() For Each UsrSht In ActiveWorkbook.Worksheets UsrSht.PageSetup.PrintArea = "$A$1:$F$30" Next UsrSht End Sub thanks, Annabel -- annabel ------------------------------------------------------------------------ annabel's Profile: http://www.excelforum.com/member.php...o&userid=26520 View this thread: http://www.excelforum.com/showthread...hreadid=441414 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thank you very much - that is exactly what I need!! I appreciate your time and knowledge -- annabe ----------------------------------------------------------------------- annabel's Profile: http://www.excelforum.com/member.php...fo&userid=2652 View this thread: http://www.excelforum.com/showthread.php?threadid=44141 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
minimum function but want to exclude zero | Excel Discussion (Misc queries) | |||
Average Function but exclude info | New Users to Excel | |||
Exclude worksheets from workbook print | Excel Discussion (Misc queries) | |||
How do I exclude the HIGH and LOW values in the =AVERAGE function | Excel Worksheet Functions | |||
How to exclude all letter using find and replace function? | Excel Programming |