SaraWitch
Active Member
- Joined
- Sep 29, 2015
- Messages
- 322
- Office Version
- 365
- Platform
- Windows
Hello fellow Excel peeps!
I want to record the date an Excel sheet was updated in cell G1. So far I have tried:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Range("G1") = Now()
Application.EnableEvents = True
End Sub
and:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 2 Then
ActiveSheet.Cells(7, 1).Value = TODAY()
End If
End Sub
and:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim cell As Range
Set rng = Intersect(Target, Columns("A:T"))
If rng Is Nothing Then Exit Sub
Application.EnableEvents = False
Application.ScreenUpdating = False
For Each cell In rng
Cells(cell.Row, "2") = Now()
Next cell
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
But none are working for me and I can't work out what I'm doing wrong!
And if I can add who last updated the sheet in H1, that would grand!
Using Excel 365....
Any help would be appreciated as need to finish the spreadsheet today!
Ta muchly, folks!
Sara
I want to record the date an Excel sheet was updated in cell G1. So far I have tried:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Range("G1") = Now()
Application.EnableEvents = True
End Sub
and:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 2 Then
ActiveSheet.Cells(7, 1).Value = TODAY()
End If
End Sub
and:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim cell As Range
Set rng = Intersect(Target, Columns("A:T"))
If rng Is Nothing Then Exit Sub
Application.EnableEvents = False
Application.ScreenUpdating = False
For Each cell In rng
Cells(cell.Row, "2") = Now()
Next cell
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
But none are working for me and I can't work out what I'm doing wrong!
And if I can add who last updated the sheet in H1, that would grand!
Using Excel 365....
Any help would be appreciated as need to finish the spreadsheet today!
Ta muchly, folks!
Sara