Command button - won't execute twice in sequence
Hello --
I have 3 command buttons (btnA, btnB, btnC) on a worksheet, each performing
the same task on 3 different columns:
- Click button
- show UserForm (contains only a listbox)
- click listbox item
- selected item is assigned to a cell below the button; form closes
Each button works fine if btnB is clicked, for example, after btnA.
Problem: btnA will not show the UserForm if clicked immediately after
clicking btnA the first time.
The user might have made a mistake and wants to select a different item from
the listbox; I don't want him/her to have to click another button just to
make the desired one "active" again.
Code for listbox Click event is:
Private Sub lstSelectComponent_Click()
'clicking a model in listbox selects the model ID
Dim strCellEqpSelName As String 'range name of cell holding selected
eqp name
strCellEqpSelName = "sel_" & g_strCellEqpSel
Cells.Range(strCellEqpSelName).Value = Me.lstSelectComponent.Value
frmSelectComponent.Hide
Exit Sub
End Sub
Can someone tell me what is wrong with my approach? Is there some code
needed to "re-activate" the clicked button?
Thanks for any help.
Larry Mehl
|