View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David Adamson[_3_] David Adamson[_3_] is offline
external usenet poster
 
Posts: 40
Default 2 column List box

I'm trying to fill a 2 column list box.



I am not referencing the second column correctly as the results appear in
the same column. I have had a good look through some stuff but can't work
out where I'm going wrong.



Thanks in advance



------------------



With Worksheets("MD Catch " & Area_Selection.Which_Catchment.ListIndex + 1)



'The range is row 6, column 1 , ("a6:b,end")then find end of columns by
codes

Set rng = Range(.Cells(6, 1 + col), .Cells(Rows.Count, 2 + col).End(xlUp))

vArr = rng.Value



'select form "Area-Selection and clear drop down box " ZoneDefinition"

Area_Selection.ZoneDefinition.Clear



'then retrieve the data

j = -1

For i = LBound(vArr) To UBound(vArr)

j = j + 1

'then paste list data into form "Area-Selection and drop down box
"ZoneDefintion"

Area_Selection.ZoneDefinition.ColumnCount = 2



Area_Selection.ZoneDefinition.AddItem vArr(i, 1)

Area_Selection.ZoneDefinition.List(j, i) = rng(i, 1).Row

Area_Selection.ZoneDefinition.AddItem vArr(i, 2)

Area_Selection.ZoneDefinition.List(j, i) = rng(i, 2).Row



Next



End With