SantanaKRE8s
Board Regular
- Joined
- Jul 11, 2023
- Messages
- 131
- Office Version
- 365
- Platform
- Windows
I have a VBA code to add a time stamp when ever the value of a cell is changed, but I am using a Count function in the cell, so I noticed the time stam is not working. Is there a way to make it work with the Function so that this is being modified automatically.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyDataRng As Range
Set MyDataRng = Range("C8:C13")
If Intersect(Target, MyDataRng) Is Nothing Then Exit Sub
On Error Resume Next
If Target.Offset(0, 1) = "" Then
Target.Offset(0, 1) = Now
End If
Target.Offset(0, 2) = Now
End Sub
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyDataRng As Range
Set MyDataRng = Range("C8:C13")
If Intersect(Target, MyDataRng) Is Nothing Then Exit Sub
On Error Resume Next
If Target.Offset(0, 1) = "" Then
Target.Offset(0, 1) = Now
End If
Target.Offset(0, 2) = Now
End Sub