ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How does one show an intital value in the combobox (https://www.excelbanter.com/excel-programming/372321-how-does-one-show-intital-value-combobox.html)

susan

How does one show an intital value in the combobox
 
I have a simple combobox with numbers:
Private Sub ComboBox7_DropButtonClick()
ComboBox7.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9",
"10")
End Sub

I would like the "1" to appear as a default. I have tried but cant
find anything for this!

Thanks
Mike


John Fuller

How does one show an intital value in the combobox
 
Setting the Value property to "1" should do the trick. You can do this
through code or though the properties window.


susan wrote:
I have a simple combobox with numbers:
Private Sub ComboBox7_DropButtonClick()
ComboBox7.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9",
"10")
End Sub

I would like the "1" to appear as a default. I have tried but cant
find anything for this!

Thanks
Mike



Tom Ogilvy

How does one show an intital value in the combobox
 
Private Sub ComboBox7_DropButtonClick()
ComboBox7.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9",
"10")
Combobox7.ListIndex = 0
End Sub

But if you have other Combobox7 events, this might fire the event.

--
Regards,
Tom Ogilvy

"susan" wrote:

I have a simple combobox with numbers:
Private Sub ComboBox7_DropButtonClick()
ComboBox7.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9",
"10")
End Sub

I would like the "1" to appear as a default. I have tried but cant
find anything for this!

Thanks
Mike




All times are GMT +1. The time now is 09:49 PM.

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