Hiding the userFormDuring Print Preview Advice Please

G

Guest

I am using the following code which hides the user form during Print Preview.
How do I incorporate code to return (Unhide?) the UserForm if I click close
on the preview window?
Private Sub cmdPrintPreview_Click()
Sheet1.PageSetup.PrintArea = "A1:U13"
UserForm1.Hide
Application.Dialogs(xlDialogPrintPreview).Show

End Sub
Thanks
Demot
 
G

Guest

ahhh, just as I posted it came to me....!!
UserForm1.show.....as below..... If any one has any suggestions of better
ways to achieve this.....with any reasons why it would be better done an
alternate way..... they would be appreciated.

Private Sub cmdPrintPreview_Click()
Sheet1.PageSetup.PrintArea = "A1:U13"
UserForm1.Hide
Application.Dialogs(xlDialogPrintPreview).Show
UserForm1.Show

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top