ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Default value of msoControlComboBox (https://www.excelbanter.com/excel-programming/433635-default-value-msocontrolcombobox.html)

Benjamin

Default value of msoControlComboBox
 
I'd like to have a default value of -Select Action-
for my combobox drop down menu.
I know how to add items... but how do I have a intial value that
shows default, before a user selects anything?

'<<--Button 4 Acad Actions
' Create a button with an image on the bar and set some
' properties.
Set ComBarContrl = ComBar.Controls.Add(Type:=msoControlComboBox)
With ComBarContrl
'the facId line will let you choose an icon
' If you choose to use the faceId then the caption is not displayed
.FaceId = 1081
.Style = msoButtonIconAndCaption
.AddItem "First Item", 1
.AddItem "Second Item", 2
'.DropDownWidth = 200
.DropDownLines = 3
.Caption = "Action"
.TooltipText = "Select Acad Edit Action"
.Width = 130
End With

dksaluki

Default value of msoControlComboBox
 
you should be able to set the .Value property of the combo box.

dk


All times are GMT +1. The time now is 08:44 PM.

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