Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format cells based on Date

Status
Not open for further replies.

wayneryeven

Technical User
May 21, 2004
101
GB
Hey all
I have a simple worksheet with a Date in Column A. All i want to do is loop through each row until the end, and IF the date is WITHIN CURRENT DATE+3 then change the font colour to Red.

I have a formula in Column B that compares A2 to Current Date+3 and enters in a value. However id like to flag the rows a different colour, and for the formatting only to apply to the number of ACTIVE rows in A.

I trust this makes sense, im sure it is achievable so all comments and suggestions welcomed!
 
I'd have a look at Conditional Formatting.

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
As HarleyQuinn says, Conditional Formatting. A condition of =A1 < (TODAY()+3)
might do the trick.

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
I dont want to go to Conditional formatting due to the sheer number of rows and the impact on performance that Conditional formatting will have?
 
I think looping the rows will have a much greater performance impact than the conditional formatting will ever have (and has had in my testing of both solutions).

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
For a single use it can be done with advanced filter and manual formatting, after selection hidden cells are not formatted.

combo
 
-> sheer number of rows
How many are we talking about?

[tt][blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
I want format the excel cells for dates in such a way. If an user puts in date 030909 than it will automatically change to 03/09/09. I have tried to format the cell using custom setting to dd/mm/yy but when I enter 030909 than it gives me a bunch of # signs indicating invalid date. Does anyone know how to format this way.
 


Hi,

You need to read and UNDERSTAND this faq...

faq68-5827

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
wayner1980: I would try conditional formatting but if you want to "loop through..... " then you should be posting in forum707.
Looping is an inefficient solution. Try filtering and formatting the filtered cells only.

Without vba or conditional formatting I would:
create a cell Today()+3 as an Advanced Filter criteria

You could also apply an AutoFilter to column B ("I have a formula in Column B that compares A2 to Current Date+3 and enters in a value).

Either way having filtered your data to only show the rows you want to be red: Select visible cells only and format them.

You may need to first remove the existing formatting.

Having told you how without VBA (macros) you can of course switch the macro recorder on andf record yourself doing the above....


Gavin
 
Hi huotivgmail,

If you re-enter your query as a separate thread, I may be able to help you.

It is not appropriate for obvious reasons to have two subjects in the one thread, regardless of how similar they may appear to be.

Good Luck!
Peter Moran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top