Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I fill a ComboBox with two items, say "X"
and "Y", using VBA? All help is appreciated |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Add a userform in the VBA Editor called UserForm1 On that userfom add a combo box called ComboBox1 Write this code in the userform:s Initialize event: Private Sub UserForm_Initialize() With ComboBox1 .AddItem "X" .AddItem "Y" ' Set default text. .Text = "X" End With End Sub Add a module and write this code in the module in order to show the userform. Sub TestForm() UserForm1.Show End Sub HTH /Ulrik .. "Ed" skrev i meddelandet ... How can I fill a ComboBox with two items, say "X" and "Y", using VBA? All help is appreciated |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ed wrote:
How can I fill a ComboBox with two items, say "X" and "Y", using VBA? If you want it at the initialization, you need to use the Initialize event: Private Sub UserForm_Initialize() ComboBox1.AddItem "X" ComboBox1.AddItem "Y" End Sub But in general: ComboBox1.AddItem "X" Regards, -- Beto Reply: Erase between the dot (inclusive) and the @. Responder: Borra la frase obvia y el punto previo. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
filling combo boxes from single outer source | Excel Discussion (Misc queries) | |||
filling information from one cell and filling another. | Excel Worksheet Functions | |||
filling combo box | Excel Programming | |||
Filling a combo box from another workbook | Excel Programming | |||
Filling multiple cells based on 1 combo box selection | Excel Programming |