Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Change the date when there is a change in another cell

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Change the date when there is a change in another cell

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

"Kelly P" wrote:

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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Change the date when there is a change in another cell

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.
--
HTH...

Jim Thomlinson


"Kelly P" wrote:

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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Change the date when there is a change in another cell

Exactly what I wanted...thanks so much!

"Jim Thomlinson" wrote:

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.
--
HTH...

Jim Thomlinson


"Kelly P" wrote:

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?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Change the date when there is a change in another cell

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.

"Jim Thomlinson" wrote:

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.
--
HTH...

Jim Thomlinson


"Kelly P" wrote:

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?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Change the date when there is a change in another cell

Figured it out...thanks guys

"Kelly P" wrote:

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.

"Jim Thomlinson" wrote:

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.
--
HTH...

Jim Thomlinson


"Kelly P" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 make 1 date cell automatically change another date cell Scotty Excel Worksheet Functions 4 April 22nd 10 09:01 AM
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
Use date modified to change format & create filter to track change PAR Excel Worksheet Functions 0 November 15th 06 09:17 PM
Change conditional formatting to coloured alternate rows dependent on a change in date? StargateFan[_3_] Excel Programming 4 August 2nd 06 11:28 AM
change background row color with change of date in a cell Urszula Excel Discussion (Misc queries) 5 May 17th 06 07:56 AM


All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"