ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding items to a ComboBox in Excel VBA (https://www.excelbanter.com/excel-programming/306051-adding-items-combobox-excel-vba.html)

Glenn Speed

Adding items to a ComboBox in Excel VBA
 
I would like to be able to dynamically add new items to a combobox
using the contents of cells in the spreadsheet. for example, C3..C6
contain the info to be added to the combobox. Can someone tell me the
code to accoplish this. I am familiar with the ComboBox.AddItem
property, but I would like to populate the combobox directly from the
spreadsheet.

Thanks in advance to anyone.

papou[_9_]

Adding items to a ComboBox in Excel VBA
 
Hello Glenn
For i = 1 to 6
Combobox1.additem(worksheets("Sheet1").cells(i,3). Value
Next i

HTH
Cordially
Pascal

"Glenn Speed" a écrit dans le message de
om...
I would like to be able to dynamically add new items to a combobox
using the contents of cells in the spreadsheet. for example, C3..C6
contain the info to be added to the combobox. Can someone tell me the
code to accoplish this. I am familiar with the ComboBox.AddItem
property, but I would like to populate the combobox directly from the
spreadsheet.

Thanks in advance to anyone.





All times are GMT +1. The time now is 08:12 AM.

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