ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA code help for item tracking. (https://www.excelbanter.com/excel-programming/326077-vba-code-help-item-tracking.html)

[email protected]

VBA code help for item tracking.
 
Hello,
I'm asking for vba code (or resources on the web) that will help with
the following:

When a date is entered in cell a1, I would like excel to calculate if
that date was 120 days ago from TODAY(). If it wasn't, leave the cell
format alone. If it was, change the background color (to notify me the
item is overdue) until a date is entered in b1. When a date is entered
in b1, remove background color from a1 (to notify me that the item has
been checked-in).

Thanks for any help,
Russ


Myrna Larson

VBA code help for item tracking.
 
I don't think you need VBA for this. Conditional Formatting should take care
of it. Check it out in Help. Select A1, then Format/Conditional Formatting,
Format Is

=IF(AND(B1="",TODAY()-A1120))

Then select the format you want for overdue items.


On 23 Mar 2005 17:57:24 -0800, wrote:

Hello,
I'm asking for vba code (or resources on the web) that will help with
the following:

When a date is entered in cell a1, I would like excel to calculate if
that date was 120 days ago from TODAY(). If it wasn't, leave the cell
format alone. If it was, change the background color (to notify me the
item is overdue) until a date is entered in b1. When a date is entered
in b1, remove background color from a1 (to notify me that the item has
been checked-in).

Thanks for any help,
Russ



David

VBA code help for item tracking.
 
Myrna Larson wrote

=IF(AND(B1="",TODAY()-A1120))


Results in 'Your formula contains an error' i.e. needs something between
last 2 ))

--
David

Mike Fogleman

VBA code help for item tracking.
 
Just use the AND function
AND(B1="",TODAY()-A1120)

Mike F

"David" wrote in message
...
Myrna Larson wrote

=IF(AND(B1="",TODAY()-A1120))


Results in 'Your formula contains an error' i.e. needs something between
last 2 ))

--
David




[email protected]

VBA code help for item tracking.
 
Thanks for all of the responses! I'm wondering if anyone is seeing the
same thing I am: When I apply that formula to a blank cell, the cell
changes to the formatting I selected without me entering a date. Is
there a default date value in each cell that is evaluated in the
formula that would cause this change? The formula works beautifully if
there is a date already in the cell.

Many thanks again,
Russ



All times are GMT +1. The time now is 06:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com