buttergoose
New Member
- Joined
- Dec 19, 2023
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
Hi!
I've found great help in this forum, but now I need help I couldn't find in existing threads.
I have used this code, to generate an automatic time and date in an excel sheet my work uses for logging activity. Very simple; event text goes in column G, date generates per auto in column A and C.
Now, question;
When I fill an event, and trigger the auto fill for date and time, how can I stop the date/time cells from updating if I come back later and edit the text in column G (and hence prompting a new auto update with current date/time)? I only need one static entry of date and time for when the event text was entered, and then I want it to not change at all.
This is the code I've used and it works splendid for everything a part from this:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
If Not Intersect(Target, Columns("G")) Is Nothing Then
If Target.Row > 1 And Target.Offset(, 2) = "" Then
Target.Offset(, -6) = Date
Target.Offset(, -5) = Time
End If
End If
End If
End Sub
Suggestion on what to add/change to get where I wanna be?
Many thanks!
I've found great help in this forum, but now I need help I couldn't find in existing threads.
I have used this code, to generate an automatic time and date in an excel sheet my work uses for logging activity. Very simple; event text goes in column G, date generates per auto in column A and C.
Now, question;
When I fill an event, and trigger the auto fill for date and time, how can I stop the date/time cells from updating if I come back later and edit the text in column G (and hence prompting a new auto update with current date/time)? I only need one static entry of date and time for when the event text was entered, and then I want it to not change at all.
This is the code I've used and it works splendid for everything a part from this:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then
If Not Intersect(Target, Columns("G")) Is Nothing Then
If Target.Row > 1 And Target.Offset(, 2) = "" Then
Target.Offset(, -6) = Date
Target.Offset(, -5) = Time
End If
End If
End If
End Sub
Suggestion on what to add/change to get where I wanna be?
Many thanks!