I tried to populate an array for a "2 columns" combobox from named ranges but I had a lot of issues. So I do not like to use this option anymore. Is anyone can help me?
To populate
range1: "This workbook" "sheetname" "(A1:A20)"
And
range2: "This workbook" "sheetname" "(B1:B20)"
"And Ignoring and excluding any blank cells". So my combobox list items won't include any empty row.
the rest of the codes wikk follow as follows.
********************
ReDim Data(1 To rng1.Rows.Count, 2) 'Set size of array. Assumes rng1 and rng2 have equal length!
'Load values range 1
For Each cl In rng1
rw = rw + 1
Data(rw, 1) = cl.Value
Next
'Load values range 2
rw = 0
For Each cl In rng2
rw = rw + 1
Data(rw, 2) = cl.Value
Next
'Fill listbox with data
Me.ComboBox9.List = Data
**********************
Thanks very much....
To populate
range1: "This workbook" "sheetname" "(A1:A20)"
And
range2: "This workbook" "sheetname" "(B1:B20)"
"And Ignoring and excluding any blank cells". So my combobox list items won't include any empty row.
the rest of the codes wikk follow as follows.
********************
ReDim Data(1 To rng1.Rows.Count, 2) 'Set size of array. Assumes rng1 and rng2 have equal length!
'Load values range 1
For Each cl In rng1
rw = rw + 1
Data(rw, 1) = cl.Value
Next
'Load values range 2
rw = 0
For Each cl In rng2
rw = rw + 1
Data(rw, 2) = cl.Value
Next
'Fill listbox with data
Me.ComboBox9.List = Data
**********************
Thanks very much....