Hello again friends,
I am trying to populate a combobox (inside a userform) with 2 columns. Like:
COL 1 COL 2
A 1
B 2
C 3
... and so on.
I am using the list method (although i have tried with additem to no success either). What I need is for the box to display a list like:
A : 1
B : 2
C : 3
... and so on (with the colom and all, although not as important. But ideally, I need to have a separator between each column item in each row)
Here is the code I've have so far:
Sub UserForm_Initialize()
Dim sht As Worksheet 'source worksheet
Dim nRow As Double '# of items in range
Dim lst As Range 'Range where 2 source coulumns are (cols 6 and 7)
Set sht = ThisWorkbook.Sheets("VALUES")
nRow = sht.Range("F2").End(xlUp).row
Set lst = sht.Range(Cells(2, 6), Cells(nRow, 7))
With frm_incidencia.cbb_defectos
.ColumnCount = 2
.BoundColumn = 1 'return value from column 1 when item selected
.list = lst.Value
End With
End Sub
I'm getting strange behaviors, like the box being populated from rows 1 and 2 of the spreadsheet only from the first column.
I am very confused with this.
As always, I appreciate any advice
Bookmarks