Fill a combobox

  • Thread starter Thread starter karibou
  • Start date Start date
K

karibou

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
 
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)
 
Thanks very much for your help !!!!

Bob said:
*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)
 
Back
Top