Hello,
I have been scouring this forum trying to find an answer to this question (forgive me if it's here somewhere that I could not locate). Anyway, here's my scenario:
I have Excel 2016. My workbook contains two pages:
I have a macro that I currently use on sheet 2 in order to decide how many pages to print that I activate using radio buttons (appropriately named "print one page" and "print two pages". Here is my current macro:
Sub SetPrintAreaOnSheet2()
Select Case UCase(Sheets("Sheet2").Range("V5"))
Case "1"
ActiveSheet.PageSetup.PrintArea = "$A$1:$Y$56"
Case "2"
ActiveSheet.PageSetup.PrintArea = "$A$1:$Y$109"
End Select
End Sub
This macro works great as long as I select Sheet 2 and have the radio buttons on that sheet. I would like to be able to change the print area for sheet two, but have the radio buttons on sheet 1. However, by moving the radio buttons to Sheet 1, the macro does not change the print area on sheet 2. I assume that my problem lies where it says "ActiveSheet". What do I need to change in order to move the radio buttons to sheet 1 and still have them control the print area on sheet 2?
Thank you so much for your help!
Sincerely,
Bri2000
I have been scouring this forum trying to find an answer to this question (forgive me if it's here somewhere that I could not locate). Anyway, here's my scenario:
I have Excel 2016. My workbook contains two pages:
- Sheet 1 - Data entry sheet. All data gets entered onto this sheet.
- Sheet 2 - The sheet that I print and give to the customer. This sheet is either one or two pages based on the amount of info I need to enter on the first page.
I have a macro that I currently use on sheet 2 in order to decide how many pages to print that I activate using radio buttons (appropriately named "print one page" and "print two pages". Here is my current macro:
Sub SetPrintAreaOnSheet2()
Select Case UCase(Sheets("Sheet2").Range("V5"))
Case "1"
ActiveSheet.PageSetup.PrintArea = "$A$1:$Y$56"
Case "2"
ActiveSheet.PageSetup.PrintArea = "$A$1:$Y$109"
End Select
End Sub
This macro works great as long as I select Sheet 2 and have the radio buttons on that sheet. I would like to be able to change the print area for sheet two, but have the radio buttons on sheet 1. However, by moving the radio buttons to Sheet 1, the macro does not change the print area on sheet 2. I assume that my problem lies where it says "ActiveSheet". What do I need to change in order to move the radio buttons to sheet 1 and still have them control the print area on sheet 2?
Thank you so much for your help!
Sincerely,
Bri2000