ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   New macro (https://www.excelbanter.com/excel-programming/356094-new-macro.html)

Kujo21

New macro
 

I'm trying to create a new macro so that I can calculate dates and the
results show up as a cell being a solid color. Heres the info I'm
working with. I have a future date, I need to compare it to todays
date. When there are 14+ days its green, 2-13 days yellow, 0-1 red, a
- number is black. Any help would be greatly appreciated. I'm just
learning all this.


--
Kujo21
------------------------------------------------------------------------
Kujo21's Profile: http://www.excelforum.com/member.php...o&userid=32484
View this thread: http://www.excelforum.com/showthread...hreadid=522693


Carim

New macro
 
Hi Kujo,

You don't need a macro ...
Try Format Conditional Formatting
Under Condition Select Formulais ,
and for example =B2today()
then select format according to your choices...

HTH
Cheers
Carim


Kujo21[_2_]

New macro
 

Thanks for the reply, I'm still a but confused. do I actually type
today in or the date. whats in the ()? will this cover the 14 days
out or 7 days out? Sorry I totally am new as you see!


--
Kujo21
------------------------------------------------------------------------
Kujo21's Profile: http://www.excelforum.com/member.php...o&userid=32484
View this thread: http://www.excelforum.com/showthread...hreadid=522693


Carim

New macro
 
Kujo,

In a cell of your choice, type in the date you want to test ....

Then Go to Menu Format Conditional Formatting
and play around with the sample formula to understand how it works ...

Only then you can move on and refine your formula according to your
needs ..

HTH
Carim


Doug Glancy

New macro
 
Kujo21,

Highlight all the cells you want to format, then, as Carim said, use
Conditional Formatting - Format Conditional Formatting.
In the leftmost dropdown box, stick with the default, "Cell Value Is."
In the second box, choose "greater than."
In the third type "=TODAY() + 14" without the quotes. Today() is the Excel
function that returns today's date.
Click the Format button, then the patterns tab, then choose your color.

You'll actually need a different conditional formatting for each different
length. You can have up to 3. The conditions are evaluated from 1 to 3, and
once a condition is met, the next ones aren't evaluated. So your first
condition should check for 14 days, 2nd for 2 days, etc.

One more thing. I often find that I do all of the above, and my formatting
doesn't work. I go back into CF and see that it's put quotes around my
formula in the 3rd box. If I wasn't so lazy, I'd figure out why, but when I
remove the quotes, the CF works.

hth,

Doug

"Kujo21" wrote in
message ...

I'm trying to create a new macro so that I can calculate dates and the
results show up as a cell being a solid color. Heres the info I'm
working with. I have a future date, I need to compare it to todays
date. When there are 14+ days its green, 2-13 days yellow, 0-1 red, a
- number is black. Any help would be greatly appreciated. I'm just
learning all this.


--
Kujo21
------------------------------------------------------------------------
Kujo21's Profile:
http://www.excelforum.com/member.php...o&userid=32484
View this thread: http://www.excelforum.com/showthread...hreadid=522693





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

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