2 column List box

  • Thread starter Thread starter David Adamson
  • Start date Start date
D

David Adamson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top