Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use CallByName. E.g.,
Dim S As String S = "CommandButton1_Click" CallByName UserForm1, S, VbMethod The CommandButton1_Click must be declared as Public. Cordially, Chip Pearson Microsoft Most Valuable Professional, Excel, 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com On Fri, 26 Feb 2010 12:32:03 -0800, sarndt wrote: In a Userform, I have multiple command buttons. For example: D1_Click D2_Click Depending on another event that occurs, I want to calculate in code the button name that I will be triggering the click event and then trigger the event. For example Application.Run "D" & i & "_Click" with i being the value of 1 or 2. Application.Run doesn't appear to work in the Userform. Thanks Steve |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Centralizing a command button on a userform | Excel Programming | |||
print command from command button in userform causes double chart | Excel Programming | |||
BUG: print command from command button in userform causes double c | Excel Programming | |||
Userform Command Button not available until another command buttonhas been used | Excel Programming | |||
Use Command Button from each Row to fill UserForm | Excel Programming |