Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default HELP - Automatic Conditional formatting

Hello,

I have a spreadsheet that basically holds date values in one column going
down.

Basically what i want to do is say "If the date in a cell is 1 day away then
turn the cell fill color red, if it's 2-3 days away turn it yellow"

Is there a one liner that can be used as a global statement within the sheet
to evaluate all cells on the sheet and change color for those that satisfy
the condition or must this be done cell by cell?

Please help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default HELP - Automatic Conditional formatting

You could do it with conditional formatting.

Select all the affected cells, then do Data=Formatting = conditional
formatting.

Change cell Value is to Formula is

(assume A1 is the active cell in the selection - you set up the formula
relative to the active cell and use relative and absolute references as
appropropriate)

=(A1-today())<=1.5

Select the format button and select the red pattern

add a second condition

=(A1-today())<3.5

select the format button and select the yellow pattern

--
Regards,
Tom Ogilvy


"Adam" wrote in message
...
Hello,

I have a spreadsheet that basically holds date values in one column going
down.

Basically what i want to do is say "If the date in a cell is 1 day away

then
turn the cell fill color red, if it's 2-3 days away turn it yellow"

Is there a one liner that can be used as a global statement within the

sheet
to evaluate all cells on the sheet and change color for those that satisfy
the condition or must this be done cell by cell?

Please help



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default HELP - Automatic Conditional formatting

What if every once and a while a row needed to be added, will the conditional
formatting be automatically inserted into the new cell? Can you do that with
some code? or would i have to copy the formatting over everytime a new row is
inserted?

"Tom Ogilvy" wrote:

You could do it with conditional formatting.

Select all the affected cells, then do Data=Formatting = conditional
formatting.

Change cell Value is to Formula is

(assume A1 is the active cell in the selection - you set up the formula
relative to the active cell and use relative and absolute references as
appropropriate)

=(A1-today())<=1.5

Select the format button and select the red pattern

add a second condition

=(A1-today())<3.5

select the format button and select the yellow pattern

--
Regards,
Tom Ogilvy


"Adam" wrote in message
...
Hello,

I have a spreadsheet that basically holds date values in one column going
down.

Basically what i want to do is say "If the date in a cell is 1 day away

then
turn the cell fill color red, if it's 2-3 days away turn it yellow"

Is there a one liner that can be used as a global statement within the

sheet
to evaluate all cells on the sheet and change color for those that satisfy
the condition or must this be done cell by cell?

Please help




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default HELP - Automatic Conditional formatting

I believe if you have xl2000 or later and have it set to Extend Data Range
Formats and Formulas in Tools=Options= Edit tab, it will automatically
apply the conditional formatting.

If not, you can use code like this:

Sub Add_A_Row()
ActiveCell.Offset(1, 0).EntireRow.Insert
ActiveCell.Offset(1, 0).EntireRow.FillDown
ActiveCell.Offset(1, 0).EntireRow.ClearContents
End Sub

Unlike a straight insert, this would add a row below the selected cell.

--
Regards,
Tom Ogilvy


"Adam" wrote in message
...
What if every once and a while a row needed to be added, will the

conditional
formatting be automatically inserted into the new cell? Can you do that

with
some code? or would i have to copy the formatting over everytime a new row

is
inserted?

"Tom Ogilvy" wrote:

You could do it with conditional formatting.

Select all the affected cells, then do Data=Formatting = conditional
formatting.

Change cell Value is to Formula is

(assume A1 is the active cell in the selection - you set up the formula
relative to the active cell and use relative and absolute references as
appropropriate)

=(A1-today())<=1.5

Select the format button and select the red pattern

add a second condition

=(A1-today())<3.5

select the format button and select the yellow pattern

--
Regards,
Tom Ogilvy


"Adam" wrote in message
...
Hello,

I have a spreadsheet that basically holds date values in one column

going
down.

Basically what i want to do is say "If the date in a cell is 1 day

away
then
turn the cell fill color red, if it's 2-3 days away turn it yellow"

Is there a one liner that can be used as a global statement within the

sheet
to evaluate all cells on the sheet and change color for those that

satisfy
the condition or must this be done cell by cell?

Please help






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Conditional Formatting joey Excel Discussion (Misc queries) 1 December 15th 09 08:58 AM
automatic formatting Larry Gagnon Excel Discussion (Misc queries) 1 March 19th 09 06:25 PM
automatic formatting [email protected] Excel Worksheet Functions 5 March 4th 08 06:59 PM
Automatic formatting help? Mel Excel Discussion (Misc queries) 6 June 20th 06 05:35 PM
Automatic Row Formatting Chris Hughes Excel Discussion (Misc queries) 3 April 14th 05 11:17 PM


All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"