I have a workbook with multiple sheets. Is there a way to designate an entire sheet as non printing, even if you select print entire workbook ?
the last page of the workbook is a change log and does not need to be printed
Thanks
Steve
I have a workbook with multiple sheets. Is there a way to designate an entire sheet as non printing, even if you select print entire workbook ?
the last page of the workbook is a change log and does not need to be printed
Thanks
Steve
Hi,
Have a look at this thread, which might help you:
http://www.excelforum.com/excel-prog...worksheet.html
Regards,
Aardigspook
If your problem is solved, please go to 'Thread Tools' on your first post and 'Mark Thread as Solved'.
You don't need to give me rep if I helped, but thanks are appreciated.
I tested this and it worked out.
I added the following code to ThisWorkbook in VB Editor (Alt+F11):
This printed all sheets except for the last sheet.![]()
Please Login or Register to view this content.
Make Mom proud: Add to my reputation if I helped out!
Make the Moderators happy: Mark the Thread as Solved if your question was answered!
Wow,
That was quick. I always try to do a search first but if you don't word it exactly ......
So I see this code form the other post:
Sub Prntouts()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Visible = xlSheetVisible And _
ws.Name <> "HotKey Codes" Then ws.PrintOut
Next ws
End Sub
I don't use VBA code frequently enough to know good code from bad, Does this look like it will work ? / I should just be able to edit the sheet name "HotKey Codes" and be good
Thanks
Steve
You gotta follow the RULES Use code tags around code.
Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
As for the code itself, it should work just fine, but you'd still need to use some Event trigger to prevent the normal print function from occuring.
You always just edit the string in the code to match the worksheet name you're using in your actual workbook.
On ThisWorkbook:
![]()
Please Login or Register to view this content.
If I had an index as the very last sheet that I didn't want printed, and I named it Kitten_Explosion I could just alter the code as I did above.![]()
Please Login or Register to view this content.
Last edited by daffodil11; 07-28-2015 at 11:48 AM.
Sorry about that, I'll remember to use the code tags on the next go around
I wish I had more opportunities to work with VBA. it's amazing how powerful it is I just don't use it enough to be comfortable with it yet.
Thank you for your help.
I taught myself from nothing to a level of reasonable proficiency over the last 18 months, mostly by tinkering and reverse engineering.
The basic language is easy enough (it doesn't break its own rules, and there are only a few of them), but the real hard part is the extensive object library and item's properties (adjectives) and methods (verbs).
Here's a hot tip if you have Excel 2010: Go to File->Options->Trust Center->Trust Center Settings...->Privacy Options and deselect the top box for "Connect to Office.Com"
By doing so, you enable the intrinsic help files that come with the software, and they're pretty dang useful.
In VB Editor, hit F2, and search for something you're curious about. How about the word "PrintOut" of the Sheets class? Select it and hit the ? or F1. Now you can see all of it in a tidy little help file.
Thanks for the tip on the instinctive help, I've set up excel per your instructions. We had an offsite IT guy here that was very good at writing code. He would write the code and explain it as he went along. The company recently spun off his division so I no longer have access to his help. I'm glad I found this forum, it has been very helpful
Thanks again
Steve
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks