Try this:
restraint_cy.xlsm
Public Sub ProcessText()
Dim Cell As Excel.Range
Dim Rows As Excel.Range
Dim Cells As Excel.Range
For Each Cell In ActiveSheet.UsedRange
If Cell.Value Like "*restraint*" Then
If Cells Is Nothing Then
Set Cells = Cell
Else
Set Cells = Union(Cells, Cell)
End If
If Rows Is Nothing Then
Set Rows = Cell.EntireRow
Else
Set Rows = Union(Rows, Cell.EntireRow)
End If
End If
Next
MsgBox "Rows containing 'restraint': " & vbCrLf & Rows.Address & vbCrLf & vbCrLf & "Cells containing 'restraint': " & vbCrLf & Cells.Address, vbInformation
Rows.Select
End Sub
Bookmarks