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!
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!