"A VBA ListBox will not display more than 10 columns of data unless you link the ListBox to Range using the "RowSource" property."
Private Sub lstTools_Click()
With lstTools
txtDept = .List(.ListIndex, 0)
txtTools = .List(.ListIndex, 1)
txtStatus = .List(.ListIndex, 2)
txtDateRet = .List(.ListIndex, 3)
txtRetBy = .List(.ListIndex, 4)
txtActive = .List(.ListIndex, 5)
txtMT = .List(.ListIndex, 6)
txtInspBy = .List(.ListIndex, 7)
txtVerBy = .List(.ListIndex, 8)
txtDateInsp = .List(.ListIndex, 9)
txtDateVer = .List(.ListIndex, 10)
txtDamaged = .List(.ListIndex, 11)
txtComments = .List(.ListIndex, 12)
End With
End Sub
Private Sub UserForm_Initialize()
Dim mysheet As Worksheet, lastrow As Long
Set mysheet = ThisWorkbook.Sheets("Tracker")
lastrow = mysheet.Cells(Rows.Count, 1).End(xlUp).Row
Me.lstTools.ColumnCount = 13
Me.lstTools.ColumnWidths = "50;50;30;60;50;30;50;50;50;50;50;50;200"
Me.lstTools.RowSource = mysheet.Range("A2:M" & lastrow).Address(External:=True)
End Sub
Bookmarks