J
jrperez.munloiza
Ok, here is this one:
I would like to search for a particular data in a range and when it
finds it, say it found 10 ocurrences of the criteria, show the results
in a multicolumn listbox, being one of the column the cell address.
This is what I have until now:
Private Sub btnSrch_Click()
ActiveWorkbook.Sheets("Registry").Activate
Range("a8:a2010").Select
Selection.Find(What:=txtSrchTerm.Text, After:=ActiveCell,
LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False).Activate
With ListBox1
.AddItem
.List(0, 0) = ActiveCell.Offset(0, 46).Value
.List(0, 1) = ActiveCell.Value
.List(0, 2) = ActiveCell.Offset(0, 48).Value
.List(0, 3) = ActiveCell.Offset(0, 46).Address
End With
End Sub
' txtSrchTerm = a text box in the userform with the criteria to search
But that gives me only the first cell matching the criteria in the
listbox. How do I show all the results in the listbox?
I would like to search for a particular data in a range and when it
finds it, say it found 10 ocurrences of the criteria, show the results
in a multicolumn listbox, being one of the column the cell address.
This is what I have until now:
Private Sub btnSrch_Click()
ActiveWorkbook.Sheets("Registry").Activate
Range("a8:a2010").Select
Selection.Find(What:=txtSrchTerm.Text, After:=ActiveCell,
LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False).Activate
With ListBox1
.AddItem
.List(0, 0) = ActiveCell.Offset(0, 46).Value
.List(0, 1) = ActiveCell.Value
.List(0, 2) = ActiveCell.Offset(0, 48).Value
.List(0, 3) = ActiveCell.Offset(0, 46).Address
End With
End Sub
' txtSrchTerm = a text box in the userform with the criteria to search
But that gives me only the first cell matching the criteria in the
listbox. How do I show all the results in the listbox?