Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible?

I have several worksheets that i need to print off.
But since i can add more sheets to this workbook,
i want to be able to print off all the sheets (not by name) except for about
3 sheets i can name.

Currently i have a macro that specifies each sheet by name then prints 1
page from it.
But as i have now added a couple of sheets to it, i need to keep adding more
code to it to include the newly added sheets.

My thinking is if i can have a code that will print all sheets a specified
page(1) except for,
say sheet1, sheet2 and sheet3.

Is this possible?

Corey....


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible?

Dim sh as Worksheet
for each sh in Thisworkbook.Worksheets
if sh.Name < "Sheet1" and sh.name _
< "Sheet2" and sh.Name < "Sheet3" then

' do something with Sh

end if
Next

--
Regards,
Tom Ogilvy

"Corey" wrote in message
...
I have several worksheets that i need to print off.
But since i can add more sheets to this workbook,
i want to be able to print off all the sheets (not by name) except for
about 3 sheets i can name.

Currently i have a macro that specifies each sheet by name then prints 1
page from it.
But as i have now added a couple of sheets to it, i need to keep adding
more code to it to include the newly added sheets.

My thinking is if i can have a code that will print all sheets a specified
page(1) except for,
say sheet1, sheet2 and sheet3.

Is this possible?

Corey....



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible?

Thanks Tom.
Too easy.

Cheers.
"Tom Ogilvy" wrote in message
...
Dim sh as Worksheet
for each sh in Thisworkbook.Worksheets
if sh.Name < "Sheet1" and sh.name _
< "Sheet2" and sh.Name < "Sheet3" then

' do something with Sh

end if
Next

--
Regards,
Tom Ogilvy

"Corey" wrote in message
...
I have several worksheets that i need to print off.
But since i can add more sheets to this workbook,
i want to be able to print off all the sheets (not by name) except for
about 3 sheets i can name.

Currently i have a macro that specifies each sheet by name then prints 1
page from it.
But as i have now added a couple of sheets to it, i need to keep adding
more code to it to include the newly added sheets.

My thinking is if i can have a code that will print all sheets a
specified page(1) except for,
say sheet1, sheet2 and sheet3.

Is this possible?

Corey....





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
Excel ignores "Sheets in new workbook" setting [email protected] Excel Discussion (Misc queries) 3 February 21st 09 10:11 PM
Set sem__ = Sheets("template").Copy(befo=Sheets(1)) [email protected] Excel Programming 2 August 18th 06 05:59 AM
"With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets Punsterr Excel Programming 3 February 21st 06 04:01 AM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork[_3_] Excel Programming 6 January 26th 06 06:31 PM
Sheets("Sheet1").Move After:=Sheets(2) Arturo Excel Programming 2 January 19th 06 07:33 PM


All times are GMT +1. The time now is 11:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"