TheGreatest
01-09-2005, 01:08 PM
Hi,
I have a UserForm with 40 CommandButtons and I have the following macro to call another UserForm with that CommandButtons.
Sub Show_checkin()
Load checkin
checkin.Show
End Sub
if I add the following code to each button, everything works fine
Private Sub button1_Click()
Call Show_checkin
End Sub
Private Sub button2_Click()
Call Show_checkin
End Sub
Private Sub button3_Click()
Call Show_checkin
End Sub
Private Sub button4_Click()
Call Show_checkin
End Sub
Private Sub button5_Click()
Call Show_checkin
End Sub
'
'and this goes up to 40th button...
What I want to know is; is there any shorter way to do this action? I mean one code will work for every button.
Thanks in advance
I have a UserForm with 40 CommandButtons and I have the following macro to call another UserForm with that CommandButtons.
Sub Show_checkin()
Load checkin
checkin.Show
End Sub
if I add the following code to each button, everything works fine
Private Sub button1_Click()
Call Show_checkin
End Sub
Private Sub button2_Click()
Call Show_checkin
End Sub
Private Sub button3_Click()
Call Show_checkin
End Sub
Private Sub button4_Click()
Call Show_checkin
End Sub
Private Sub button5_Click()
Call Show_checkin
End Sub
'
'and this goes up to 40th button...
What I want to know is; is there any shorter way to do this action? I mean one code will work for every button.
Thanks in advance