CF cannot give you messages, only change formatting.
To have the message shown you would need a formula in an adjacent cell.
Assume A1 is to be red...........in B1 enter
=IF(A1>365,"A1 has exceeded 365 days")
Alternative would be to use VBA event code to pop up a message box and color at
the same time.
Private Sub Worksheet_Calculate()
On Error GoTo stoppit
Application.EnableEvents = False
With Me.Range("A1")
If .Value > 365 Then
.Interior.ColorIndex = 3
MsgBox "Please be advised that A1 has exceeded 365 days"
End If
End With
stoppit:
Application.EnableEvents = True
End Sub
This is sheet event code. Right-click on the sheet tab and "View Code".
Copy/paste the above into that sheet module.
Edit the range "A1" to suit.
Alt + q to return to the Excel window
Gord Dibben MS Excel MVP
>All,
>How to me excel to give an error message on a conditional format?Like for
>example if a cell is greater than 365 besides giving a red background as it
>is conditional formatted, it also should shoot an error message in the screen
>saying for instance "over 365 dyas" or something. Your help is appreciated.
>Thanks.
alish - 21 Apr 2008 07:46 GMT
Gord, Thanks, it worked!
> CF cannot give you messages, only change formatting.
>
[quoted text clipped - 35 lines]
> >saying for instance "over 365 dyas" or something. Your help is appreciated.
> >Thanks.
Gord Dibben - 21 Apr 2008 20:57 GMT
Thanks for the feedback.
Which one did you go with?
Gord
>Gord, Thanks, it worked!
>
[quoted text clipped - 37 lines]
>> >saying for instance "over 365 dyas" or something. Your help is appreciated.
>> >Thanks.