Try this
Private Sub UserForm_Initialize()
Dim oneCell As Range
Dim RangeOfCells as Range
With Sheet1.Range("T:T")
Set RangeOfCells = Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlup))
End With
With ListBox1
.Clear
.ColumnCount = 2: Rem can be set at design time
.ColumnWidths = ";0": Rem can be set at design time
For Each oneCell In RangeOfCells
If Val(oneCell.Value) = 12 Then
.AddItem oneCell.Offset(0, -2).Value
.List(.ListCount - 1, 1) = oneCell.Offset(0, -2).Address(, , , True)
End If
Next oneCell
End With
End Sub
But if you are going to different sheets, hiding the user form, changing cells which change column T and going back to look at the user form, that code should be moved to the Activate event rather than the Intialize event.
Bookmarks