Hi Dan
In addition to stanleydgromjr's code (slightly modified), this code is in the attached...see if it does as you require. Run GetNames procedure...it then calls GetData procedure.
Sub GetData()
Dim w2 As Worksheet, w4 As Worksheet
Dim LR As Long
Dim Rng As Range
Dim lRng As Range
Dim nCell As Range
Dim rFoundCell As Range
Dim lCount As Long
Dim x As String
Dim y As String
Dim NR As Long
Set w2 = Worksheets("Sheet2")
LR = w2.Cells(Rows.Count, 4).End(xlUp).Row
Set w4 = Worksheets("Sheet4")
Set Rng = Range("Names")
For Each nCell In Rng
Set lRng = w2.Range("D:D").Find(What:=nCell, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
MatchCase:=False)
If Not lRng Is Nothing Then
x = lRng.Row
y = x + 75
End If
Set rFoundCell = w2.Range("E" & x)
If Not WorksheetFunction.CountIf(w2.Range("E" & x & ":E" & y), nCell) = 0 Then
For lCount = 1 To WorksheetFunction.CountIf(w2.Range("E" & x & ":E" & y), nCell)
Set rFoundCell = Columns(5).Find(What:=nCell, After:=rFoundCell, _
LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
With rFoundCell
NR = w4.Range("A" & Rows.Count).End(xlUp).Offset(1).Row
If NR = 2 And w4.Cells(1, 1) = "" Then NR = 1
w4.Range("A" & NR).Resize(2, 5).Value = _
rFoundCell.Offset(0, -1).Resize(2, 5).Value
End With
Next lCount
Else
MsgBox "No records found for " & nCell
End If
Next nCell
w4.Columns.AutoFit
End Sub
Bookmarks