ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using VB to change Combo box selection (https://www.excelbanter.com/excel-programming/312971-using-vbulletin-change-combo-box-selection.html)

Richard Clayton

Using VB to change Combo box selection
 

From within a VBA macro, I want to select an option from within a
dropdown list (combobox), so that once the macro has run, the combo box
is reset ready for the next use.

The combo box is populated from a static range within the same
worksheet.

For example:

Choose Name
Andrew
Brian
Charlotte
Diana

I want the Combo Box to be set by the macro to "Choose Name".

I have checked through the info on the forum and some is relevant but I
cannot get syntax etc quite right. I get error messages that say Object
not defined etc. (Still learning!). I have tried Dim cb As Object, and
various other futile forays into the unknown.

The Combo box appears to be named "DropDown2" - automatically.

Would be very grateful for a little help!

Thanks

Richard Clayton


--
Richard Clayton
------------------------------------------------------------------------
Richard Clayton's Profile: http://www.excelforum.com/member.php...o&userid=15122
View this thread: http://www.excelforum.com/showthread...hreadid=267610



All times are GMT +1. The time now is 01:46 AM.

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