Change the date when there is a change in another cell

  • Thread starter Thread starter Kelly P
  • Start date Start date
K

Kelly P

I have an excel spreadsheet that I would like to have the date changed to the
current date when another cell value is changed. Is this possible?
 
Yes it's possible but you don't provide much to go on.
Right click the sheet tab, view code and paste this in. When A1 changes A2
gets the date put in. You can have a range of cells and adjust the offeset

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Target.Offset(1, 0).Value = Date
End If
End Sub

Mike
 
Here is some code for you to try. It must be placed in the sheet you want to
react to the change. Right click the sheet tab and select view code... add
the following

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

If Cell A1 is changed then the current date (and time) is added to cell B1.
You can format the cell to not show the time.
 
Exactly what I wanted...thanks so much!

Jim Thomlinson said:
Here is some code for you to try. It must be placed in the sheet you want to
react to the change. Right click the sheet tab and select view code... add
the following

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

If Cell A1 is changed then the current date (and time) is added to cell B1.
You can format the cell to not show the time.
 
How would I get it to change throughout the whole sheet? What I have is a
list of products, I want a corresponding cell to automatically put in the
current date when the price field gets changed. Such as when A24 is changed
B24 puts in todays date.
 
Figured it out...thanks guys

Kelly P said:
How would I get it to change throughout the whole sheet? What I have is a
list of products, I want a corresponding cell to automatically put in the
current date when the price field gets changed. Such as when A24 is changed
B24 puts in todays date.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top