ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combo Boxes (https://www.excelbanter.com/excel-programming/285386-combo-boxes.html)

GrahamD[_5_]

Combo Boxes
 
I have created multiple worksheets with the first being used as a men
page, this has a Combo Box with names that when a selected name i
clicked, takes you to that persons worksheet.

This works fine except that when you come back to the menu page, th
Combo Box has the last persons name that you selected highlighted, bu
you can't reselect the same person, you have to select a different nam
for it to work!!

Is there a way around this??

Any help appreciated thanks...
cheers
Graha

--
Message posted from http://www.ExcelForum.com


Bob Umlas, Excel MVP[_2_]

Combo Boxes
 
You can have the combo box's Listindex be set back to -1 when something is selected and the correct page is activated so nothing is selected when you return to the menu page.

Cliff Myers

Combo Boxes
 
Just add this to the sheet that the combobox is on in the worksheet
activate_event:
'change combobox1 to the name of your combobox

Combobox1.value = ""

"GrahamD" wrote in message
...
I have created multiple worksheets with the first being used as a menu
page, this has a Combo Box with names that when a selected name is
clicked, takes you to that persons worksheet.

This works fine except that when you come back to the menu page, the
Combo Box has the last persons name that you selected highlighted, but
you can't reselect the same person, you have to select a different name
for it to work!!

Is there a way around this??

Any help appreciated thanks...
cheers
Graham


---
Message posted from http://www.ExcelForum.com/




Bob Phillips[_6_]

Combo Boxes
 
If you use Bob's technique and set the ListIndex in the click event, you
might want to stop the combox click event being fired again when you set
ListIndex to -1. This sort of thing shows the basic principle

Dim fReEntry As Boolean

Private Sub ComboBox1_Change()

If Not fReEntry Then
fReEntry = True
MsgBox ComboBox1.Value
ComboBox1.ListIndex = -1
End If
fReEntry = False

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob Umlas, Excel MVP" wrote in
message ...
You can have the combo box's Listindex be set back to -1 when something is

selected and the correct page is activated so nothing is selected when you
return to the menu page.




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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com