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

JSH720

Board Regular
Joined
Oct 9, 2009
Messages
109
Office Version
  1. 365
Platform
  1. Windows
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?

Thanks!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Paste the following to the worksheet module:
Code:
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




TheEnd:


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


End Sub
 
Upvote 0

Forum statistics

Threads
1,223,880
Messages
6,175,154
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top