How do i add in a last updated function for a series of cells?
Hi Tab,
Copy the following sub routine, right click on the worksheet tab and select
View Code; then paste into the Visual Basic for the worksheet.
Let me know how this works for you.
Thanks,
Peggy
Private Sub Worksheet_Change(ByVal Target As Range)
'Txt is the cocatenated text from the target row
Dim txt
For Each cell In Range(Cells(Target.Row, 1), Cells(Target.Row, 25))
txt = txt & cell.Text
Next
'The following checks the first 25 columns for changes
If Target.Column < 26 And txt < Cells(Target.Row, 27).Text Then
Cells(Target.Row, 26).Select
'The following enters current time as value
ActiveCell.FormulaR1C1 = "=NOW()"
ActiveCell.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
'The following returns the cursor to the target cell
Cells(Target.Row, Target.Column).Select
Application.CutCopyMode = False
Cells(Target.Row, 27) = txt
End If
End Sub
"Tab" wrote:
Thank you, perhaps my email was not very clear. i am trying to get a script
for the date at the end of each line to show the last updated date.
Thanks again for your efforts however!
"pshepard" wrote:
You can go to the Tools menu, Track Changes submenu, Highlight Changes,
select the range of cells.
Peggy
"Tab" wrote:
How do i add in a last updated function for a series of cells? I want to be
able to see when users update information.
|