Click to Hide the Clicked commandbutton1? Possible

obaid_457

New Member
Joined
Jul 27, 2017
Messages
6
I have a user form A5 Size and there is commandbutton1 in right down corner of user form
whenever I print user from on page the commandbutton1 also print on page

is there any Code when I click commandbutton1 to print the page. then the button should hide???

and not be print on page
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Something like this should work.
Code:
Private Sub CommandButton1_Click()
    CommandButton1.Visible = False
    Me.Repaint
    Application.ScreenUpdating = True
    ' print routine
    CommandButton1.Visible = True
End Sub
 
Upvote 0
I just Change a little and I got what I want
Thanks dear

Code:
Private Sub CommandButton1_Click()
    CommandButton1.Visible = False
    UserForm1.PrintForm
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top