Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help needed - populating comboboxes from list??
Here is code for the UserForm to populate ComboBox1. I leave ComboBox2
for you. Use the Properties Window to set the ColumnCount and ColumnWidths properties. I set ColumnHeads to False. It may not be possible to use column headings when you are skipping some columns and rows in the source area. Private Sub UserForm_Activate() Dim rng As Range Dim iRow As Integer Dim iCt As Integer iRow = Sheets("Sheet1").Range("A1").End(xlDown).Row Set rng = Sheets("Sheet1").Range("A2:A" & iRow) For Each c In rng If c.Offset(0, 4) < "" And c.Offset(0, 5) = "" Then iCt = iCt + 1 ComboBox1.AddItem c ComboBox1.Column(1, iCt - 1) = c.Offset(0, 2) ComboBox1.Column(2, iCt - 1) = c.Offset(0, 3) End If Next c End Sub HTH, Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
.AddItem list and populating combobox with created list | Excel Discussion (Misc queries) | |||
Populating Comboboxes | Excel Programming | |||
populating list | Excel Programming | |||
Populating dropdown list 2 with data depending upon what was selected in list 1 | Excel Programming | |||
Populating ComboBoxes | Excel Programming |