ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Populating Active X Controls (https://www.excelbanter.com/excel-programming/272466-populating-active-x-controls.html)

Steven Stadelhofer

Populating Active X Controls
 
Can you tell me how to populate an Active X Control -
e.g., a combo box with a small list e.g., three items,
like apples, oranges, and pears. I am not familiar with
Visual basic - can this be done somewhere in the
properties window?

Thank you,
Steve

steve

Populating Active X Controls
 
Steven,

If you put your list on a worksheet and name the range, just put this name
as the ListFillRange (if the combobox is on a worksheet), or put it as the
RowSource (if the combobox is on a form).

Or use this code (note that I used the activate event, you can use any event
or put it into a standard sub):

Private Sub UserForm_Activate()

With ComboBox1
.AddItem "apples"
.AddItem "oranges"
.AddItem "pears"
End With

End Sub

steve

"Steven Stadelhofer" wrote in message
...
Can you tell me how to populate an Active X Control -
e.g., a combo box with a small list e.g., three items,
like apples, oranges, and pears. I am not familiar with
Visual basic - can this be done somewhere in the
properties window?

Thank you,
Steve





All times are GMT +1. The time now is 12:27 PM.

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