View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
OKLover[_2_] OKLover[_2_] is offline
external usenet poster
 
Posts: 26
Default How to click the button from module?

Thank you

"Harald Staff" wrote:

Sub Demo()
Call UserForm1.CommandButton1_Click
End Sub


HTH. Best wishes Harald

"OKLover" skrev i melding
...
What if the commandbutton is on the userform? how to call it?

"Tom Ogilvy" wrote:

If you make it public instead of private

Public Sub CommandButton1_Click()

end Sub

then in another module you can do

Sheet1!CommandButton1_Click

Where sheet1 is the code name of the sheet containing the code.
--
Regards,
Tom Ogilvy

"OKLover" wrote in message
...
Hi, all

Does it possible to click the commandbutton(or activate the
commandbutton_click event) on the userform from the global module?