scottclayton
New Member
- Joined
- Apr 20, 2014
- Messages
- 8
Greetings Lovers of Excel,
In making my label printer, I will need to set the print area for multiple sheets based on a range generated in a cell. E.g. Sheet1 might need cells A1:P1200 set as print area, Sheet2 might need cells A1:G694 set as the print area, Sheet3 might not need to be printed, etc..
I have no problem generating a formula to state what the print area for each sheet should be, respectively, but passing that info into VBA has me really stumped. (Using indirect in the Page Setup menu doesn't work after the value has changed—it changes the value to a static reference, which is bizarre). I suspect I'd want to use the Sub Workbook_BeforePrint, but I'm not 100% on that. Anyone have any ideas? I will generally have 3 or more specific sheets selected—using a button-triggered macro that gets a cell value of sheet names and selects those sheets. Any ideas for different ways of going about this if my above-mentioned idea seems like it could be supplanted?
Thanks!
In making my label printer, I will need to set the print area for multiple sheets based on a range generated in a cell. E.g. Sheet1 might need cells A1:P1200 set as print area, Sheet2 might need cells A1:G694 set as the print area, Sheet3 might not need to be printed, etc..
I have no problem generating a formula to state what the print area for each sheet should be, respectively, but passing that info into VBA has me really stumped. (Using indirect in the Page Setup menu doesn't work after the value has changed—it changes the value to a static reference, which is bizarre). I suspect I'd want to use the Sub Workbook_BeforePrint, but I'm not 100% on that. Anyone have any ideas? I will generally have 3 or more specific sheets selected—using a button-triggered macro that gets a cell value of sheet names and selects those sheets. Any ideas for different ways of going about this if my above-mentioned idea seems like it could be supplanted?
Thanks!