Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to run sub?
How to run sub from sub? I want to run for example CommandButton1_Click() from other control sub. -- Boban ------------------------------------------------------------------------ Boban's Profile: http://www.excelforum.com/member.php...o&userid=28560 View this thread: http://www.excelforum.com/showthread...hreadid=482541 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to run sub?
I assume that the CommandButton_Click is an event in a worksheet?
So make it public, and call with Call Sheet1!CommandButton1_Click -- HTH RP (remove nothere from the email address if mailing direct) "Boban" wrote in message ... How to run sub from sub? I want to run for example CommandButton1_Click() from other control sub. -- Boban ------------------------------------------------------------------------ Boban's Profile: http://www.excelforum.com/member.php...o&userid=28560 View this thread: http://www.excelforum.com/showthread...hreadid=482541 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to run sub?
From another control in the same Worksheet or userform?
Just execute it like you would any macro Private Sub CommandButton2_Click() CommandButton1_Click msgbox "Executed the click event for CommandButton1" End Sub -- Regards, Tom Ogilvy "Boban" wrote in message ... How to run sub from sub? I want to run for example CommandButton1_Click() from other control sub. -- Boban ------------------------------------------------------------------------ Boban's Profile: http://www.excelforum.com/member.php...o&userid=28560 View this thread: http://www.excelforum.com/showthread...hreadid=482541 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to run sub?
Good coding practice would be to remove the code from
CommandButton1_Click and move it to a separate procedure that could be called from anywhere. "Boban" wrote in message ... How to run sub from sub? I want to run for example CommandButton1_Click() from other control sub. -- Boban ------------------------------------------------------------------------ Boban's Profile: http://www.excelforum.com/member.php...o&userid=28560 View this thread: http://www.excelforum.com/showthread...hreadid=482541 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|