Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a 2-column list box, but I can't figure out how to add items to the second column. Any help would be greatly appreciated. Thanks, Mika |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if you are using the rowsource or listfillrange, just set the reference to
two columns Sheet1!A1:B20 Also, set the columncount property to 2 if not, how are you populating the listbox? -- Regards, Tom Ogilvy "mika" wrote in message ... Hi, I have a 2-column list box, but I can't figure out how to add items to the second column. Any help would be greatly appreciated. Thanks, Mika |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am populating from a one dimensional array. I have two one dimensional arrays, so I want to populate the first column with values from the 1st array, and the second coumn with values from the 2nd array. Thanks, mika -----Original Message----- if you are using the rowsource or listfillrange, just set the reference to two columns Sheet1!A1:B20 Also, set the columncount property to 2 if not, how are you populating the listbox? -- Regards, Tom Ogilvy "mika" wrote in message ... Hi, I have a 2-column list box, but I can't figure out how to add items to the second column. Any help would be greatly appreciated. Thanks, Mika . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Private Sub UserForm1_Initialize() Dim myArr1 As Variant Dim myArr2 As Variant Dim iCtr As Long myArr1 = Array("a", "b", "c", "d") myArr2 = Array("1", "2", "3", "4") With Me.ListBox1 .ColumnCount = 2 For iCtr = LBound(myArr1) To UBound(myArr1) .AddItem CStr(myArr1(iCtr)) .List(.ListCount - 1, 1) = myArr2(iCtr) Next iCtr End With End Sub mika wrote: Hi, I am populating from a one dimensional array. I have two one dimensional arrays, so I want to populate the first column with values from the 1st array, and the second coumn with values from the 2nd array. Thanks, mika -----Original Message----- if you are using the rowsource or listfillrange, just set the reference to two columns Sheet1!A1:B20 Also, set the columncount property to 2 if not, how are you populating the listbox? -- Regards, Tom Ogilvy "mika" wrote in message ... Hi, I have a 2-column list box, but I can't figure out how to add items to the second column. Any help would be greatly appreciated. Thanks, Mika . -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding some list items | Excel Discussion (Misc queries) | |||
Adding/deleting items from a pivot table dropdown list | Excel Discussion (Misc queries) | |||
adding a formula to items in a drop down list | Excel Discussion (Misc queries) | |||
Adding items on an existing drop-down list | Excel Discussion (Misc queries) | |||
I have a question about adding information to a list of items that have cells linked to another worksheet. | Excel Discussion (Misc queries) |