mea02300,
Give this a try:
Sub tgr()
Dim wsData As Worksheet
Dim wsDest As Worksheet
Dim rngFound As Range
Dim rngCopy As Range
Dim strFirst As String
Dim strFind As String
strFind = InputBox("Enter the keyword to be searched for in columns A and F:", "Find Text")
If Len(strFind) = 0 Then Exit Sub 'Pressed cancel
Set wsData = Sheets(1)
Set wsDest = Sheets(2)
Set rngFound = wsData.Range("A:A,F:F").Find(strFind, , xlValues, xlPart)
If Not rngFound Is Nothing Then
strFirst = rngFound.Address
Set rngCopy = rngFound.EntireRow
Do
Set rngCopy = Union(rngCopy, rngFound.EntireRow)
Set rngFound = wsData.Range("A:A,F:F").Find(strFind, rngFound, xlValues, xlPart)
Loop While rngFound.Address <> strFirst
rngCopy.EntireRow.Copy wsDest.Cells(Rows.Count, "A").End(xlUp).Offset(1)
rngCopy.EntireRow.Delete xlShiftUp
End If
Set wsData = Nothing
Set wsDest = Nothing
Set rngFound = Nothing
Set rngCopy = Nothing
End Sub
Bookmarks