I am a supporter of
St. Joseph's hospice.
 If you find this site useful or if it helped you, consider a small donation to
St. Joseph's, please.

Information on
St. Joseph's

JustGiving - Sponsor me now!



Here is a simple example of an event procedure. The Worksheet_Change sub is showing aging information for some input data by placing a time stamp in column A whenever a cell in row 4 to 13 has been changed. Conditional formats in A4:A13 will highlight the "age" of the corresponding rows:
Green indicates a change within the last minute
Yellow indicates a change within the last hour
Red shows a change within the last day

Please notice that the conditional format sets the background color as well as the font color to keep the time stamp data "invisible".

Please understand that this event procedure is only meant as an example. Normally I do not recommend using them. Please refer to my Excel VBA Dont's.


Private Sub Worksheet_Change(ByVal Target As Range)
'Provides a simple aging example on how to implement
'an easy to spot age information of your data.
'Reverse("moc.LiborPlus.www") V0.10 PB 16-May-2010
Dim vIntersect, v
Application.EnableEvents = False
Set vIntersect = Application.Intersect(Target, Me.Range("4:13"))
If vIntersect Is Nothing Then
    Application.EnableEvents = True
    Exit Sub
End If
For Each v In vIntersect
    Cells(v.Row, 1) = Date + Time
Next v
Application.EnableEvents = True
End Sub

A 17 KB Excel 2007 © sample file you can find here, open and use at your own risk, please read my disclaimer.

Sulprobil   Get it done   Contact   Disclaimer   Download