This is simple but it works
Sub find_all()
Dim strName As String, strCode As String, strDOB As String
Dim lngResultPoint As Long
Dim firstaddress As String
Dim c
''pointer to the first cell where the data will be written
lngResultPoint = 1
''set the name being searched
strName = "name to search"
''set the postcode
strCode = "code to search"
''set the DOB
strDOB = "DOB to search"
ActiveSheet.Range("L:L").Select
With Selection
Set c = .Find(What:=strName)
If Not c Is Nothing Then
firstaddress = c.Address
Do
''##A simple option is to check both criteria on the same line
If c.Offset(0, 1).Value = strCode And c.Offset(0, 2).Value = strDOB Then ''Replace column 2 with one which should contain the DOB
Worksheets("Results").Cells(lngResultPoint, 1).Value = c.Offset(0, -10).Value
lngResultPoint = lngResultPoint + 1
End If
''OR
''##you could nest them
If c.Offset(0, 2).Value = strDOB Then ''Replace column 2 with one which should contain the DOB
If c.Offset(0, 1).Value = strCode Then
Worksheets("Results").Cells(lngResultPoint, 1).Value = c.Offset(0, -10).Value
lngResultPoint = lngResultPoint + 1
End If
End If
Set c = .FindNext(c)
Loop While c.Address <> firstaddress
End If
End With
End Sub
Bookmarks