Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Custom color scheme | Excel Discussion (Misc queries) | |||
Excel color scheme | Excel Discussion (Misc queries) | |||
custom color scheme for 3d surface map | Charts and Charting in Excel | |||
Default Color Scheme | Excel Discussion (Misc queries) | |||
Color Scheme Trouble | Excel Programming |