If a cell is modified after a date; font color change indicate

J

jcampbell

In XLS, if a cell value is changed after a fixed date can the font color be
directed to change in order to indicate this.
 
V

vezerid

Right-click on the sheet tab to display VBA code for the sheet. Then
paste the following code and change the range of cells and the date as
needed.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MonitoredRange As Range
Dim LimitDate As Date
Dim inter As Range

Set MonitoredRange = Range("A1") 'You can change this to an array, e.g.
Range("A1:A10")
LimitDate = "11/15/2005"

Set inter = Application.Intersect(MonitoredRange, Target)
If (Not inter Is Nothing) And (Now > Int(LimitDate)) Then
Target.Font.ColorIndex = 3
End If

End Sub

HTH
Kostis Vezerides
 
Top