PC Review


Reply
Thread Tools Rate Thread

Change the date when there is a change in another cell

 
 
Kelly P
Guest
Posts: n/a
 
      6th Feb 2008
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 With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      6th Feb 2008
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?

 
Reply With Quote
 
Jim Thomlinson
Guest
Posts: n/a
 
      6th Feb 2008
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 With Quote
 
Kelly P
Guest
Posts: n/a
 
      6th Feb 2008
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?

 
Reply With Quote
 
Kelly P
Guest
Posts: n/a
 
      6th Feb 2008
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 With Quote
 
Kelly P
Guest
Posts: n/a
 
      6th Feb 2008
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 make 1 date cell automatically change another date cell Scotty Microsoft Excel Worksheet Functions 3 22nd Apr 2010 06:15 AM
date in Cell to change colors if the date is beyond today's date Pete Elbert Microsoft Excel Misc 2 6th Jun 2009 06:31 AM
Automatically change cell colors based on date in cell Greg Microsoft Excel Misc 1 27th Jan 2009 05:53 PM
change background row color with change of date in a cell =?Utf-8?B?VXJzenVsYQ==?= Microsoft Excel Misc 5 17th May 2006 07:56 AM
How can i change cell colour depending on month of date in cell? andy75 Microsoft Excel Misc 2 6th Jan 2006 07:46 AM


Features
 

Advertising
 

Newsgroups
 


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