Custom template and print areas

kate61487

New Member
Joined
Oct 18, 2016
Messages
11
Hello! hoping a guru out there can help me fix this issue.

I'm working on a vba that takes a data sheet of sold inventory and "prints" it into packing labels (actually populates the data on multiple printing label sheets and then exports PDFs). The labels have some special formatting to make it print nicely (narrow rows as borders between labels, merged cells, etc.). it's basically a mail merge inside excel (but I need to keep it inside excel for other executable steps, I cant actually replace the process with a mail merge.)

Since the formatting was slowing it down so much I had an idea to pre-format a page, save it as a template, and then load that page as the new sheet; this way the macro only has to populate the data. it works great except that my template has 1,000 formatted labels and now my vba prints 1,000 labels whether there are 5 or 700 with actual data inside. When I open the blank template sheet and view page break preview it shows every formatted cell as the print area, even when I clear the print area. Seems like excel doesn't consider an empty merged cell to be empty. Any tips for what i can do within my vba when printing or changes I can make to the blank formatted template to ignore those empty cells when printing/exporting?

Thanks!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,224,828
Messages
6,181,204
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top