Hi all
The application: VBA macro in which various Excel worksheets get printed, depending on the user's print selection via radio buttons.
The problem: As part of the macro, the print range has to be set, and the number of pages in the printed report echoed to the user, both of which depend on the relevant worksheet selected for printing. My coding for this is:
where both Print_Range and dPages are declared variables, and both operate correctly. EXCEPT, that as the user selects successive sheets to print, neither the Print_Range nor the dPages variables change, unless for each radio button option, the relevant sheets("name"). selected is included. That makes sense to me, but I don't really want the worksheets to be changing on the screen all the time as the user selects a different sheet to print. Is there a correct way to let the macro know which sheet to test for xlLastCell and ExecuteExcel4Ma cro() without that sheet displaying on the screen?
I hope I've explained this clearly. Thank you guys for bringing me along in VB.
Annie
The application: VBA macro in which various Excel worksheets get printed, depending on the user's print selection via radio buttons.
The problem: As part of the macro, the print range has to be set, and the number of pages in the printed report echoed to the user, both of which depend on the relevant worksheet selected for printing. My coding for this is:
Code:
Print_Range = "A8:I" & ActiveCell.SpecialCells(xlLastCell).Row
dPages = ExecuteExcel4Macro("GET.DOCUMENT(50)")
I hope I've explained this clearly. Thank you guys for bringing me along in VB.
Annie
Comment