G
Guest
I have own CommandBar "MyMenu" with three msoCommandButton. Each
CommandButton runs the macro, I change only the rowsource for UserForm. E.g.
CommandButton(1) runs MyMacro1 with setting the rowsource="range1",
CommandButton(2) runs MyMacro2 with setting the rowsource="range2". I have
for each CommandButton own macro. Is some way how to find out which
CommandButton was pressed and this argument I can use in next code.
myPressButton = 'which CommandButton was pressed '
Sub MyMacroAll
Select Case myPressButton
Case ?: UserForm1.rowsource = "range1"
Case ??: UserForm1.rowsource = "range2"
End Select
End Sub
CommandButton runs the macro, I change only the rowsource for UserForm. E.g.
CommandButton(1) runs MyMacro1 with setting the rowsource="range1",
CommandButton(2) runs MyMacro2 with setting the rowsource="range2". I have
for each CommandButton own macro. Is some way how to find out which
CommandButton was pressed and this argument I can use in next code.
myPressButton = 'which CommandButton was pressed '
Sub MyMacroAll
Select Case myPressButton
Case ?: UserForm1.rowsource = "range1"
Case ??: UserForm1.rowsource = "range2"
End Select
End Sub