The following code will extract data based on name of horse. It currently takes the names from column C onwards and retrieves the 46 rows you required.
The output is to Sheet3.
Change highlighted code to suit
Sub Find_horses()
Dim FindString As String
Dim Rng As Range
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet3")
With ws1
For c = 3 To 6
FindString = .Cells(3, c) ' Horse's name
If Trim(FindString) <> "" Then
With Sheets("Sheet1").Range("A:A")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Rng.Offset(-2, 0).Resize(46).Copy ws2.Cells(1, c)
Else
MsgBox "Nothing found"
End If
End With
End If
Next c
End With
End Sub
Bookmarks