D
donwb
Excel 2003
On my UserForm I have several CommandButtons.
In my code, I want to refer to a selected or active one as a variable,
rather than by it's name, say CommandButton4.
So I store it's name:-
Worksheets("MyVariables").Range("A4")=UserForm1.ActiveControl.Name (which
works ok)
and instead of UserForm1.CommandButton4.BackColor = .................
I would like to do:-
UserForm1.Worksheets("MyVariables").Range("A4").BackColor =
..................
which doesn't work, as the synyax or method is wrong.
Can it be done and if so how.
On my UserForm I have several CommandButtons.
In my code, I want to refer to a selected or active one as a variable,
rather than by it's name, say CommandButton4.
So I store it's name:-
Worksheets("MyVariables").Range("A4")=UserForm1.ActiveControl.Name (which
works ok)
and instead of UserForm1.CommandButton4.BackColor = .................
I would like to do:-
UserForm1.Worksheets("MyVariables").Range("A4").BackColor =
..................
which doesn't work, as the synyax or method is wrong.
Can it be done and if so how.