How to change text to red if value in cell changes and add last updated on date to the row


Board Regular
Oct 9, 2009
I need to change the cell text format to RED if the value of the cell is changed (not formatting or just clicking in it). Additionall, when the cell is changed in a row, a column at the end needs to show the date last changed (mm/dd/yyyy) and name of computer that changedit.

Is this accomplished with conditional formatting or VBA?

How do you do it?



Well-known Member
Aug 12, 2009
Paste the following to the worksheet module:
Private Sub Worksheet_Change(ByVal Target As Range)

Dim CN As String

With Application
    .EnableEvents = False   'if this was left true the macro would trigger itself
    .ScreenUpdating = False
End With

CN = Environ("computername")  'Environ("username") would return the current user name

If Target.Cells.Count > 1 Then  'Remove or comment these rows if it doesn't matter how many cells are changed at the same time
    GoTo TheEnd 'Jumps to the end without making the changes
End If

    With Target
        .Font.ColorIndex = 3
'        Intersect(.EntireRow, Range("Z:Z")).Value = Format(Date, "mm/dd/yyyy") & " " & CN   'Always the same column
        Cells(.Row, Columns.Count).End(xlToLeft).Offset(, 1).Value = Format(Date, "mm/dd/yyyy") & " " & CN  'Alwasy the last column
    End With


With Application
    .EnableEvents = True
    .ScreenUpdating = True
End With

End Sub

Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...