I have this sub i created for Excel. The idea is to populate multi column list box from values in an excel spreadsheet. I am stepping through the code which executes fine but no values are loaded in my list. Anyone have any ideas?
Code:
Private Sub cmdContact_Click()
Dim cell As Range
Dim Rng As Range
'Me.lstEmployee.Clear 'Make sure the Listbox is empt
With ThisWorkbook.Sheets("Employee Data")
Set Rng = .Range("A2", .Range("A2").End(xlDown))
End With
For Each cell In Rng.Cells
With lstEmployee
.AddItem cell.Value
.List(.ListCount - 1, 1) = cell.Offset(0, 1).Value
.List(.ListCount - 1, 2) = cell.Offset(0, 2).Value
.List(.ListCount - 1, 3) = cell.Offset(0, 3).Value
.List(.ListCount - 1, 4) = cell.Offset(0, 4).Value
End With
Next cell
End Sub
Comment