Thread: Auto Stamp Date
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
ShePink77 ShePink77 is offline
external usenet poster
 
Posts: 4
Default Auto Stamp Date

Alan, thanks so much for the help. I have found the Alt F11 but where do I
copy and paste the below formula once the VBA Project window is open?

"Alan" wrote:

You can't do it with a formula because the NOW() function will update every
time the workbook calculates, not just when you alter B1:D1
This code will do it,

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("B1:D1")) Is Nothing Then
Range("E1") = Now
Application.EnableEvents = True
End If
End Sub

To enter this,
Press Alt and F11 to open the VB editor
On the top left you'll see VBAProject with your filename in brackets
Expand that and double click Sheet1 or whatever sheet you want to do this on
Copy and paste the code into this new window, (watch or text wrap in the
email, there should be seven lines)
Press Alt and F11 again to close the VB editor
Save the file,

Regards,
Alan.


"ShePink77" wrote in message
...
I am creating a spreadsheet and would like to know if I am working in row 1
and I make add, update or change informaiton in cells B1, C1 or D1 is it
possible to auto stamp the time and date of the add, update or change in
cell
E1? If so can you help me understand how to write the formula?