how to fill combobox with a variant ?

H

Herve cadieu

hi there

I need to used a returned variant from a function to fill a combobox
prior doing that I need to turn it in 9 columns
I have tried this code but it does not work who could help me ?

Dim DataIn As Variant
MBGetSampleDataVar DataIn
CbDataIn.ColumnCount = 9
Dim myarray
ReDim myarray(UBound(DataIn) \ 9 + 1, 9)

For i = LBound(DataIn) To UBound(DataIn)
a = IIf(i <= 9, i, i Mod 9)
n = i \ 9
myarray(n, a) = DataIn(i)

Next i


CbDataIn.Clear
CbDataIn.List() = myarray
CbDataIn.ListIndex = 1
 

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

Top