Hello, I am trying to use a macro button that allows the user to set the page breaks. The goal would be to have the button work as listed below...
As a result, if the button hasn't been clicked yet, then the sheet will be in normal mode. Then, the person would click the button to set the page break. Then, they would click the button again to confirm page breaks and switch back to normal mode.
But... it also appears that when I switch it to page break preview to set my page breaks, I will not be able to click the macro button again? Is there a way around it?
Here is my code thus far. The bold/underlined/italicized line is where I need to adjust things.
- If ActiveSheet is in PageBreakPreview mode, then switch back to normal mode
- If ActiveSheet is in Normal mode, then switch to PageBreakPreview
As a result, if the button hasn't been clicked yet, then the sheet will be in normal mode. Then, the person would click the button to set the page break. Then, they would click the button again to confirm page breaks and switch back to normal mode.
But... it also appears that when I switch it to page break preview to set my page breaks, I will not be able to click the macro button again? Is there a way around it?
Here is my code thus far. The bold/underlined/italicized line is where I need to adjust things.
Code:
Sub SetPageBreaks()
MsgBox "Once you are finished setting the page breaks, please re-click the ""Set Page Break Button"" to confirm. "
[U][B][I]ActiveWindow.View = xlPageBreakPreview[/I][/B][/U]
MsgBox "Page Breaks set up complete. Select the program you would like to export to."
End Sub