Macro to highlight a specified row
Hi Jodie
Assuming you have headers in row 1, we can use autofilter like this:
Sub Highlight()
Dim sh As Worksheet
On Error Resume Next
For Each sh In ThisWorkbook.Sheets
With sh
LastRow = .Range("B" & Rows.Count).End(xlUp).Row
.Range("B1:B" & LastRow).AutoFilter field:=1,
Criteria1:="Gauranteed"
If Err.Number 0 Then
Err.Clear
Else
.Range("B2:B" & LastRow).SpecialCells(xlCellTypeVisible).
_
EntireRow.Interior.ColorIndex = 6
.Columns("B").AutoFilter
End If
End With
Next
End Sub
Regards,
Per
On 11 Jan., 21:51, Jodie wrote:
How would I write a macro to find "Gauranteed" in any cell in Column "B" and
then highlight that row? *Also, this would be for an entire workbook.
--
Thank you, Jodie
|