ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   when press the close button in printpreview (https://www.excelbanter.com/excel-programming/363226-when-press-close-button-printpreview.html)

x taol

when press the close button in printpreview
 


Private Sub CommandButton1_Click()
Me.Hide
ActiveSheet.PrintPreview
End Sub

and, press the close button in printpreview screen, and then show the
userform.

how coding....




*** Sent via Developersdex http://www.developersdex.com ***

Jim Cone

when press the close button in printpreview
 
You have to do it all in the same sub.
Something along the lines of...

Private Sub CommandButton1_Click()
Me.Hide
ActiveSheet.PrintPreview
Excel.ActiveWindow.View = xlNormalView
DoEvents
Me.Repaint
Application.ScreenUpdating = True
Me.Show
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"x taol"
wrote in message
Private Sub CommandButton1_Click()
Me.Hide
ActiveSheet.PrintPreview
End Sub

and, press the close button in printpreview screen, and then show the
userform.
how coding....
*** Sent via Developersdex http://www.developersdex.com ***

x taol

when press the close button in printpreview
 


thank you very much

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 04:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com