Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,538
- Office Version
- 365
- 2016
- Platform
- Windows
I am not all that familiar with Excel VBA, so my apologies in advance if I don't know how to phrase my question properly.
I have a userform with 15 similar comboboxes. Each one has a change event very similar to each other in that it call a procedure. The procedure shares common instructions to reset the value of the combobox which originally called the procedure in the first place.
Right now, I am using 20 if / elseif's to direct the changes to the appropriate combobox.
What I was hoping, was to create a public variable, and in the combobox's change procedure, assign that variable to that combobox.
With that, in my procedure ...
I have a userform with 15 similar comboboxes. Each one has a change event very similar to each other in that it call a procedure. The procedure shares common instructions to reset the value of the combobox which originally called the procedure in the first place.
Right now, I am using 20 if / elseif's to direct the changes to the appropriate combobox.
What I was hoping, was to create a public variable, and in the combobox's change procedure, assign that variable to that combobox.
Code:
Private Sub cb_selection1_Change()
eg cb_out = me.cb_selection1
call external procedure in general module
End sub
With that, in my procedure ...
Code:
if blahblahblah = suchand such then
with cb_out
.value="this"
.backcolor = thiscolor
etc
end with
end if