Timestamp that want change when workbook is opened

George T

New Member
Joined
May 19, 2009
Messages
46
I trying to create a timestamp for cell A12 when data is entered into C12, but I need this time to be locked and not change when workbook is closed and reopened.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Sounds like you want to use a Worksheet_Change event procedure, which is VBA code which is automatically triggered upon some event happening (like the update of a specific cell).

Right click on the sheet tab name at the bottom and select "View Code" and paste the following VBA code in the resulting VB Editor window:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
 
'   Automatically place date/time stamo in cell A12 when C12 is manually updated
    If Target.Address = "$C$12" Then
        Target.Offset(0, -2) = Now
    End If
 
End Sub
Now, go back to your sheet and change the entry in cell C12 and see A12 update.

For more on event procedures, check out this link: http://www.cpearson.com/excel/Events.aspx
 
Upvote 0
Quote from PM: <!-- / icon and title --><!-- message -->
Thanks for help How can I get this to same for cell C12 THUR C100 and A12 THUR A100.
This modification should do that:
Code:
 Private Sub Worksheet_Change(ByVal Target As Range)
 
' Automatically place date/time stamp in cells A12:A100 when a cell in C12:C100 is manually updated
    If Not Intersect(Target, Range("C12:C100")) Is Nothing Then
        Target.Offset(0, -2) = Now
    End If
 
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,329
Members
452,635
Latest member
laura12345

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