LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default 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




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I execute buttons in Excel using a voice command? Rick Drabek Excel Discussion (Misc queries) 0 November 11th 05 10:01 PM
How do I execute command from button or hyperlink? rerhart Excel Discussion (Misc queries) 1 February 18th 05 09:41 PM
Creating command buttons beside every row to execute each row macro sirriff Excel Programming 3 September 12th 04 03:42 AM
Programming command button to execute on a different worksheet Ed[_21_] Excel Programming 4 July 29th 04 12:17 AM
Execute a menu command with VBA? Susan[_3_] Excel Programming 2 May 1st 04 07:45 AM


All times are GMT +1. The time now is 05:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"