Conditional formatting= ignore text in cells & how to trigger a macro from cell content

Guacamoley

New Member
Joined
Sep 7, 2011
Messages
10
Hello, I am fairly new to VBA and Formulas :confused: I am so far stuck with two issues (im using XL2000). Just incase it helps this database is to calculate when training courses are due.

Firstly, I have a worksheet with different dates in I have used this formula =EDATE(D5,12*D4) to calcualte what the dates will be in 5 years time -this works fine. With this result I want the cells that are equal to or more than TODAY to turn red. The formula i have been using so far is =E14<=TODAY() The problem that I am having with this is that some of the fields have text in them instead of dates and so it automatically turns them red when I want them to remain uncoloured. Is there anyway I can get it to ignore text and purely focus on the dates?

The second problem I am having is once this formula is working, how can I then get the cells that are overdue dates to trigger another macro? (This is an Email sent to the user that I have already written) Would I get this to trigger by the colour of the cell or would it have to be done by date?

I hope someone can help me!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
In your conditional formatting box
use a formula to determine which text to format
and use this formula

Code:
=IF(NOT(ISTEXT($E14)),$E14>=TODAY(),)
 
Upvote 0
The second problem I am having is once this formula is working, how can I then get the cells that are overdue dates to trigger another macro? (This is an Email sent to the user that I have already written) Would I get this to trigger by the colour of the cell or would it have to be done by date?

I hope someone can help me!

You'd need to trigger off the date, since the state of a conditional format is notoriously tricky to detect as a general case in VB. For instance, the interior.colorindex property of the cell will not change. You'd wind up having to extract the condition and then evaluating it separately anyway.
 
Upvote 0
In your conditional formatting box
use a formula to determine which text to format
and use this formula

Code:
=IF(NOT(ISTEXT($E14)),$E14>=TODAY(),)


I have come across a problem, if I wanted to make result predict 7 days prior to TODAY how would I do this?

Thanks again
 
Upvote 0

Forum statistics

Threads
1,216,745
Messages
6,132,473
Members
449,729
Latest member
davelevnt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top