Hi. I am new to macros and am trying to do the following:
I want to check if 18 months have passed from the date in a specific cell (for example, J5) and if so then check if there's text in another cell in the same row (M5) and if there's not check if cell I5 contains a specific word (abandoned) - though there might be additional text in that cell, it won't say only abandoned but might say pending-abandoned and if 18 months have passed, there isn't text in M5, and cell I5 does NOT contain the word abandoned, then color cell M5 red.
Then I need it to check all the cells in the sheet. I have another macro that will make it run in the whole workbook.
So far I've come up with this, which isn't working:
Sub PublicationDate()
Dim LastRow As Long
Dim i As Long
LastRow = Range("J" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow
If IsDate Range("J" & i).Value>Date + 540 And IsEmpty(Range("M" & i).Value) And
(FIND "Abandoned"(Range("M" & i)) Then Range("M" & i). Interior.ColorIndex = 3
End If
Next i
End Sub
Bookmarks