Hello all,
I am in need of your assistance. I have a specific range(E14:BO744). Some cells may contain comments. If a cell has a comment I want to check if inside this comment the word "home" is present. If so I want it to be colored. I am searching the internet including this forum. I didn't find a solution to my issue (perhaps I didn't do a good job a searching). I have a code but this one is failing misserabely. Can any of you Masters of Excel help me?
(below code is gathered together from different other macro's).
I am in need of your assistance. I have a specific range(E14:BO744). Some cells may contain comments. If a cell has a comment I want to check if inside this comment the word "home" is present. If so I want it to be colored. I am searching the internet including this forum. I didn't find a solution to my issue (perhaps I didn't do a good job a searching). I have a code but this one is failing misserabely. Can any of you Masters of Excel help me?
(below code is gathered together from different other macro's).
Code:
Sub test2()
Dim search As String
Dim scmt As String
Dim cmt As Comment
search = LCase("home")
Set Rng = Range("E14:BO744")
For Each cell In Rng
If Not cell.Comment Is Nothing Then
scmt = cmt.Text
If InStr(scmt, search) <> 0 Then
ActiveCell.Interior.Color = RGB(112, 48, 160)
Else
'do nothing
End If
ActiveCell.Interior.Color = RGB(217, 217, 217)
End If
Next
End Sub