View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
RMF RMF is offline
external usenet poster
 
Posts: 6
Default Date Stamp in one cell when data in other range changes

Goodday,

I have used the macro on http://www.mcgimpsey.com/excel/timestamp.htm and
it works fine. I only would like to add something. When I make a change to a
cell, I want the time of the update in 1 cell but I also would like to have
the old value in another cell.

Can anyone help me with how I can do this? I am not too good with this VBA.

Thnks!

RMF



"Dave Peterson" wrote:

Maybe...

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("C18:V32,C37:D43"), .Cells) Is Nothing Then
Application.EnableEvents = False
With Me.Range("D1")
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
End With
Application.EnableEvents = True
End If
End With
End Sub


You may want:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(me.Range("C18:V32,C37:D43"), .Cells) Is Nothing Then
Application.EnableEvents = False
me.unprotect password:="Hi"
With Me.Range("D1")
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
End With
me.protect password:="Hi"
Application.EnableEvents = True
End If
End With
End Sub

If d1 is locked on that protected sheet.


Steve E wrote:

Hi,

I tried to figure out how to make the code that JE McGimpsey has posted on
his site: http://www.mcgimpsey.com/excel/timestamp.html "DateStampMacro" but
just do not have the VBA skills to decipher how I need to change it to work
for me.

I'm trying to have a date time stamp in cell "D1" whenever my user changes
data in either of two ranges "C18:V32" and "C37:D43".

This is a customer tool for pricing and I want to record the date that they
changed inputs that affect price.

This is xl2003

These ranges have all kinds of data validation rules that are generated from
sheets that are protected and this workbook and worksheet will also be
protected to keep the user from overrighting formulas etc.

Thanks in advance!


--

Dave Peterson