Hello,
I'm currently trying to put in a range in the columnindex but keep getting an error when trying to reference columns F-J in the code below.
thanks,
I'm currently trying to put in a range in the columnindex but keep getting an error when trying to reference columns F-J in the code below.
thanks,
VBA Code:
Private Sub ListBox1_Click()
'Find last row
LastRow = form.Cells(Rows.Count, 1).End(xlUp).Row
Me.ListBox2.Clear
CurVal = Me.ListBox1.Value
For X = 2 To LastRow
If form.Cells(X, "k") = CurVal Then
'Found a match; populate listbox2
Me.ListBox2.AddItem form.Cells(X, "F:J")
End If
Next X
End Sub