Hi all, working in Excel 2010 I have an document that I want to print only certain sheets and also not print blank rows (I have rows with formulas but no data). Thank you.
Hi all, working in Excel 2010 I have an document that I want to print only certain sheets and also not print blank rows (I have rows with formulas but no data). Thank you.
Hi MARD99,
Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.
Remember to desensitize the data.
Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
Attached is a workbook similar to the one that I am trying to print. The first two worksheets (Raw Data & Report Data) I do not want to print. The other ten worksheets I do want to print but omit blank rows.
Thanks for responding to my post!!!!
You can loop through the sheets and set the print areas, then print the sheet.
Your working code would have "PrintOut" instead of "PrintPreview"
Please Login or Register to view this content.
Thanks for your post. Can you incorporate code to omit the blank rows from printing? I'm trying not to have to set the print area for each sheet.
If you already have the print area set then you can also write a macro to temprarily hide the empty rows before printing and then unhides them again.
---
Hans
"IT" Always crosses your path!
May the (vba) code be with you... if it isn't; start debugging!
If you like my answer, Click the * below to say thank-you
That's part of the problem. I don't know how to write a macro to hide empty rows.
The I guess it's time to start learning
Can you attach a file with some dummy data but that does have the page layout like you want it?
I'll write you one macro so you can modify it to your liking (at the same time it will be good training) VBA is really very simple, just a set of instructions that are carried out one after the other.
All it really does is translate your actions to lines of code.
If I have this I want it to do that else do something else, etc.
I missed that one.
I'll incorporate the code
Does this mean that you have set your print area to 99 rows?
I did not set a print area because it will be variable. The formulas in my actual file extend to row 1000.
Thse are the worksheet's printareas:
I assume that you do not want to include the ones colored redPlease Login or Register to view this content.
You should have told met that the blank rows all contain formula's
But this works:
Place the code below in ThisWorkBook Project window
and this code in a module to invoke after you have printed the pagePlease Login or Register to view this content.
This will unhide the rows again.Please Login or Register to view this content.
You could always write a macro to prompt with worksheet you want to print and at the end add the command unHideRows
Let me know if it works
Last edited by Keebellah; 07-28-2017 at 03:41 PM. Reason: syntax error
I couldn't get the code to work....it's me I'm sure! I'm worn out for the day. I'll try again tomorrow. Thanks for your help!
Can you explain what you did?
Here's the file you posted with the code
You have to run the unhide macro manually AFTER printing
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks