Timestamp in a single cell that updates automatically only when a cell value is CHANGED in a Range on one Sheet

Excel_User_10k

Board Regular
Joined
Jun 25, 2022
Messages
98
Office Version
  1. 2021
Platform
  1. Windows
Hi All,

I have seen a few things on the internet regarding time stamping when a cell is changed. However, they are always about multiple times stamps for each and every Cell that is changed in one Column, with a corresponding timestamp alongside each cell in another column.

All I wish to do is have a timestamp that only updates in once cell, P3 for example, when a change is made in any of a Range of cells, F8:P439 for instance.

I am hoping to achieve this with a Formula rather than VBA too please. That way, if someone makes a change on a mobile device rather than a PC, the time will still update. It also avoids any errors or instability that almost always seems to follow the use of VBA.

I have also noticed it usually uses the loop error system. Which is fine, but it seems to always require another Column to be used to "copy" the value of the initial Column, and that update is how the timestamp is generated. As I have a rather large table. This would seem impractical and a waste of space. Is it a case of using a Formula and having to do that, or using VBA?

Any ideas please?
 
First, I made a really serious error. When you use Worksheet change, and your code changes a cell in that worksheet, you must turn off events to prevent infinite recursion. I added the change below.

You would just take my code and add it to your Sub.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rngToFltr As Range
    
    Application.ScreenUpdating = False
    Application.EnableEvents = False

   If Not Intersect(Target, Range("F8:P439")) Is Nothing Then
      [P3] = Now
   End If

    If Not Intersect(Target, Range("J4")) Is Nothing Or _
       Not Intersect(Target, Range("G3")) Is Nothing Or _
       Not Intersect(Target, Range("G4")) Is Nothing Then
       Me.Protect Password:="password", AllowFiltering:=True, UserInterfaceOnly:=True

        With Me
            Set rngToFltr = .Range("B7:C" & .Cells(Rows.Count, "B").End(xlUp).Row)
        End With
    
        If Me.FilterMode Then Me.ShowAllData
    
        ' If month selected apply month filter
        If Range("E7") <> "" Then
            With rngToFltr
                .AutoFilter Field:=1, Criteria1:=Me.Range("E7")
            End With
        End If
        
        ' If Store criteria no Invalid ID apply Store filter
        If Range("D6") <> "" Then
            With rngToFltr
                .AutoFilter Field:=2, Criteria1:=Me.Range("D6")
            End With
        End If

    End If
    
    Application.ScreenUpdating = True
    Application.EnableEvents = True

End Sub
 
Upvote 0
Solution

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,215,471
Messages
6,125,000
Members
449,202
Latest member
Pertotal

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