I've adopted the following code from various sources. Column A's data is populating the listbox fine, with each entry populating its respective listindex, but Column B's data (which I'm trying to capture with the .list) is only acting on the first listindex. What do I change?
Hope my question is clear, and many thanks for any insights you can offer...
Code:
Private Sub UserForm_Initialize()Dim rng As Range
Dim LastRow As Long
Dim I As Long
Dim x As Integer
ListBox1.Clear
LastRow = ActiveSheet.Range("A100000").End(xlUp).Row
For I = 1 To LastRow
Set rng = ActiveSheet.Range("A" & I)
If rng.EntireRow.Hidden = True Then
With ListBox1
.AddItem rng.Value
.List(0, 1) = Range("B" & I).Value
End With
End If
Next I
End Sub
Hope my question is clear, and many thanks for any insights you can offer...