ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Fill a combobox (https://www.excelbanter.com/excel-programming/289277-fill-combobox.html)

karibou

Fill a combobox
 
Hi :)
I have a sheet who's contain a button and a combobox. I'd like to fill
the combobox when the button is pressed. Who can I do ?

Thanks for your help


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


Bob Phillips[_6_]

Fill a combobox
 
If they are form controls, create a macro with this code

ActiveSheet.Shapes("Drop Down 1").ListFillRange = "h9:h13"

and assign to the button.

If its control tollbox controls, add this code to the button click event

Private Sub CommandButton1_Click()
With Combobox1
.ListFillRange="H9:H13"
.ListIndex = 0
End WIth
End Sub

where H9:H13 bis a range holding the data to populate the control.

--

HTH

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

"karibou " wrote in message
...
Hi :)
I have a sheet who's contain a button and a combobox. I'd like to fill
the combobox when the button is pressed. Who can I do ?

Thanks for your help


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




karibou[_2_]

Fill a combobox
 
Thanks very much for your help !!!!

Bob Phillips wrote:
*If they are form controls, create a macro with this code

ActiveSheet.Shapes("Drop Down 1").ListFillRange = "h9:h13"

and assign to the button.

If its control tollbox controls, add this code to the button click
event

Private Sub CommandButton1_Click()
With Combobox1
.ListFillRange="H9:H13"
.ListIndex = 0
End WIth
End Sub

where H9:H13 bis a range holding the data to populate the control.

--

HTH

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

"karibou " wrote in message
...
Hi :)
I have a sheet who's contain a button and a combobox. I'd like to

fill
the combobox when the button is pressed. Who can I do ?

Thanks for your help


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



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



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

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