Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub HighlightHysterectomy()
- Dim cell As Range
- Dim ws As Worksheet
- Dim searchText As String
- searchText = "hysterectomy"
- ' Loop through all worksheets in the workbook
- For Each ws In ThisWorkbook.Worksheets
- ' Loop through all cells in the worksheet
- For Each cell In ws.UsedRange
- ' Check if the cell contains the word "hysterectomy"
- If InStr(1, cell.Text, searchText, vbTextCompare) > 0 Then
- ' Highlight the cell
- cell.Interior.Color = RGB(255, 0, 0) ' Highlight color: Red
- End If
- Next cell
- Next ws
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement