Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2006

Tip: Looking for answers? Try searching our database.

Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Corey - 10 Dec 2006 22:42 GMT
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....
Tom Ogilvy - 10 Dec 2006 23:24 GMT
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

Signature

Regards,
Tom Ogilvy

>I have several worksheets that i need to print off.
> But since i can add more sheets to this workbook,
[quoted text clipped - 13 lines]
>
> Corey....
Corey - 11 Dec 2006 01:35 GMT
Thanks Tom.
Too easy.

Cheers.
> Dim sh as Worksheet
> for each sh in Thisworkbook.Worksheets
[quoted text clipped - 23 lines]
>>
>> Corey....
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.