Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Input Color Scheme for Date Column

I have a column in Excel that has only dates inputed. I would like to wright
a macro that would look at the dates and do the following:

If the date is older than 30 days from the current date then make the active
cell color Red

If the date is greater than the current date then make the active cell green

Thanks
Frank
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Input Color Scheme for Date Column

Sub colr()
If Now - ActiveCell.Value 30 Then
ActiveCell.Interior.ColorIndex = 3
ElseIf ActiveCell.Value Now Then
ActiveCell.Interior.ColorIndex = 10
End If
End Sub


"Beep Beep" wrote:

I have a column in Excel that has only dates inputed. I would like to wright
a macro that would look at the dates and do the following:

If the date is older than 30 days from the current date then make the active
cell color Red

If the date is greater than the current date then make the active cell green

Thanks
Frank

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Input Color Scheme for Date Column

JLGWhiz

Works great, however (when did you hear that last).

The number of rows is not consistant so I guess I need a loop until it gets
to a blank cell. Can you help me with this.

Thanks
Frank

"JLGWhiz" wrote:

Sub colr()
If Now - ActiveCell.Value 30 Then
ActiveCell.Interior.ColorIndex = 3
ElseIf ActiveCell.Value Now Then
ActiveCell.Interior.ColorIndex = 10
End If
End Sub


"Beep Beep" wrote:

I have a column in Excel that has only dates inputed. I would like to wright
a macro that would look at the dates and do the following:

If the date is older than 30 days from the current date then make the active
cell color Red

If the date is greater than the current date then make the active cell green

Thanks
Frank

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Input Color Scheme for Date Column

Good Morning JLGWhiz

I imputed a Do statement to stop at a blank cell, and now this brings up the
question how to go past the blank cell (no date inputed) and or a ? inputed.

Thanks
Frank

"JLGWhiz" wrote:

Sub colr()
If Now - ActiveCell.Value 30 Then
ActiveCell.Interior.ColorIndex = 3
ElseIf ActiveCell.Value Now Then
ActiveCell.Interior.ColorIndex = 10
End If
End Sub


"Beep Beep" wrote:

I have a column in Excel that has only dates inputed. I would like to wright
a macro that would look at the dates and do the following:

If the date is older than 30 days from the current date then make the active
cell color Red

If the date is greater than the current date then make the active cell green

Thanks
Frank

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
Custom color scheme Tess Excel Discussion (Misc queries) 2 June 2nd 10 03:09 AM
Excel color scheme Altec6 Excel Discussion (Misc queries) 0 September 12th 08 05:00 PM
custom color scheme for 3d surface map [email protected] Charts and Charting in Excel 1 September 28th 07 02:06 AM
Default Color Scheme [email protected] Excel Discussion (Misc queries) 1 October 12th 06 06:51 PM
Color Scheme Trouble [email protected] Excel Programming 3 May 23rd 06 09:42 AM


All times are GMT +1. The time now is 12:05 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"