Please assist i want display all info in a row in the listbox currently its only showing the data in the first line i presume its something to do with the offset please help me
Private Sub TextBox207_Change()
Dim rFound As Range
Dim sFirstAddress As String
Dim LName As String
LName = TextBox207.Value
Me.ListBox1.Clear
With Worksheets("Sheet1").Range("a:ab")
Set rFound = .Find(what:=LName, LookIn:=xlValues, lookat:=xlWhole, MatchCase:=False)
If Not rFound Is Nothing Then
sFirstAddress = rFound.Address
Do
Me.ListBox1.AddItem rFound.Offset(1, 0).Value
Set rFound = .FindNext(rFound)
Loop While rFound.Address <> sFirstAddress
End If
End With
End Sub
Private Sub TextBox207_Change()
Dim rFound As Range
Dim sFirstAddress As String
Dim LName As String
LName = TextBox207.Value
Me.ListBox1.Clear
With Worksheets("Sheet1").Range("a:ab")
Set rFound = .Find(what:=LName, LookIn:=xlValues, lookat:=xlWhole, MatchCase:=False)
If Not rFound Is Nothing Then
sFirstAddress = rFound.Address
Do
Me.ListBox1.AddItem rFound.Offset(1, 0).Value
Set rFound = .FindNext(rFound)
Loop While rFound.Address <> sFirstAddress
End If
End With
End Sub