SaraWitch
Active Member
- Joined
- Sep 29, 2015
- Messages
- 378
- Office Version
- 365
- Platform
- Windows
Hello peeps,
I want an error message box to show if "Completed" is in red (rather than using a data validation input message, because I don't want it to show all the time). The code I'm using, but is not working, is:
Any help would be appreciated
I want an error message box to show if "Completed" is in red (rather than using a data validation input message, because I don't want it to show all the time). The code I'm using, but is not working, is:
VBA Code:
Sub ShowMessageBoxForRedCompletedOnAllSheets()
Dim ws As Worksheet
Dim targetCell As Range
Dim targetWord As String
targetWord = "Completed"
For Each ws In ThisWorkbook.Worksheets
Set targetCell = ws.Columns("A")
If targetCell.Font.Color = RGB(192, 0, 0) Then
MsgBox "Please enter actual start date and/or reference number", vbOKOnly, "Missing data!"
End If
Next ws
End Sub
¦ MrExcel Queries.xlsm | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | Status | other column | other column | Start date | other column | other column | Ref number | ||
2 | Completed | 12345678 | |||||||
3 | Completed | 19/08/2024 | 34567 | ||||||
4 | Open | 19/08/2024 | 2586 | ||||||
5 | Completed | 1234 | |||||||
CF Error MsgBox |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
A2:A6 | Expression | =IF($A2="Completed", OR($D2="", $G2="")) | text | NO |
Any help would be appreciated