Originally Posted by
suschuck
Sub Locate(Name As String, Data As Range)
Dim myMaxLength As Long
Dim myFormat As String
myMaxLength = 100
myFormat = String(myMaxLength, "@")
Dim rngFind As Range
Dim strFirstFind As String
Dim strCell As String
Dim strdef As Variant
With Data
Set rngFind = .Find(Name, LookIn:=xlValues, lookat:=xlPart)
If Not rngFind Is Nothing Then
strFirstFind = rngFind.Address
Do
If rngFind.Row > 1 Then
strCell = rngFind.EntireRow.Cells(1, 2).Value
strdef = rngFind.EntireRow.Cells(1, 4).Value
ListBox1.AddItem rngFind.Value
ListBox1.List(ListBox1.ListCount - 1, 1) = Data.Parent.Name
ListBox1.List(ListBox1.ListCount - 1, 2) = strCell
ListBox1.List(ListBox1.ListCount - 1, 3) = rngFind.Value
ListBox1.List(ListBox1.ListCount - 1, 4) = Format(strdef, myFormat)
ListBox1.List(ListBox1.ListCount - 1, 5) = rngFind.Address
End If
Set rngFind = .FindNext(rngFind)
Loop While Not rngFind Is Nothing And rngFind.Address <> strFirstFind
End If
End With
End Sub