I have an Excel template (wb1) containing VBA to print the set range of a sheet in another workbook (wb2) via a command button. Depending on the options chosen in wb1 will depend on which sheet w/in wb2 prints. The code works, but wk2 contains many sheets (each having their own print area set w/in the wb2 page layout); therefore, it doesn't make sense to have a set print area range w/in wb1 vba coding. It is making some sheets print two pages. What would be the best VBA code to use to have the print area set to either print the sheet using the sheets page layout print area settings or make sure no matter what sheet the code points to print it will print on one page for 100 certainty? Below is the code as it is now and I will also paste what I've gotten to work.
Code:
ActiveSheet.PageSetup.PrintArea = "$A$1:$V$40"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.Close
[end code]
What I've tried so far was changing the first line to:
[code]
ActiveSheet.PageSetup.PrintArea = ""
[end code]