Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
additem listbox
Good day,
Is it possible to use the AddItem method to a 2-column ListBox? My efforts has so far resulted in the code below but now I´am stuck. Brgds CG Rosén ------------------------------------------------- For i = 2 To 50 If Sheets("constants").Cells(i, 6).Value = 1 Item1 = Sheets("constants").Cells(i, 4) Item2 = Sheets("constants").Cells(i, 5) UserForm2.ListBox1.AddItem Item1 ' add to column 1??? UserForm2.ListBox1.AddItem Item2 ' add to column 2??? End If Next i |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
additem listbox
If Sheets("constants").Cells(i, 6).Value = 1
Item1 = Sheets("constants").Cells(i, 4) Item2 = Sheets("constants").Cells(i, 5) UserForm2.ListBox1.AddItem Item1 ' add to column 1 UserForm2.ListBox1.List(Listbox1.Listcount-1,1) = Item2 ' add to column 2 End If Next i -- Regards, Tom Ogilvy CG Rosén wrote in message ... Good day, Is it possible to use the AddItem method to a 2-column ListBox? My efforts has so far resulted in the code below but now I´am stuck. Brgds CG Rosén ------------------------------------------------- For i = 2 To 50 If Sheets("constants").Cells(i, 6).Value = 1 Item1 = Sheets("constants").Cells(i, 4) Item2 = Sheets("constants").Cells(i, 5) UserForm2.ListBox1.AddItem Item1 ' add to column 1??? UserForm2.ListBox1.AddItem Item2 ' add to column 2??? End If Next i |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
additem listbox
Set ColumnCount = 2
Dim i As Long Me.ListBox1.AddItem "" 'first add item i = Me.ListBox1.ListCount - 1 'which row after add Me.ListBox1.Column(0, i) = "AAA" 'column 1 Me.ListBox1.Column(1, i) = "BBB" 'column 2 -----Original Message----- Good day, Is it possible to use the AddItem method to a 2-column ListBox? My efforts has so far resulted in the code below but now I´am stuck. Brgds CG Rosén ------------------------------------------------- For i = 2 To 50 If Sheets("constants").Cells(i, 6).Value = 1 Item1 = Sheets("constants").Cells(i, 4) Item2 = Sheets("constants").Cells(i, 5) UserForm2.ListBox1.AddItem Item1 ' add to column 1??? UserForm2.ListBox1.AddItem Item2 ' add to column 2??? End If Next i . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
additem to combobox with an array | Excel Discussion (Misc queries) | |||
Help with: ListBox1.AddItem (ws.Name) | Excel Worksheet Functions | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming | |||
Is refreshing listbox rowsource in listbox click event possible? | Excel Programming | |||
additem to listbox built on the fly | Excel Programming |