ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting a date when cell is changed (https://www.excelbanter.com/excel-programming/353215-inserting-date-when-cell-changed.html)

Gavin Ling[_3_]

Inserting a date when cell is changed
 

Hi.

I need Excel to insert a date in a certain cell (F26) when another cell
is altered (C7). The trouble is that the date entered in F26 mustn't
change, it must always read as the date when C7 was altered.


I can't seem to make it work without the date constantly changing to
the new day's date.

Gavin


--
Gavin Ling
------------------------------------------------------------------------
Gavin Ling's Profile: http://www.excelforum.com/member.php...o&userid=30110
View this thread: http://www.excelforum.com/showthread...hreadid=512015


Jim Thomlinson[_5_]

Inserting a date when cell is changed
 
Here is some code for you to try. It only works if C7 is a constant and not a
formula. Right click the sheet tab and select view code and then paste this...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$7" Then Range("F26").Value = Date
End Sub
--
HTH...

Jim Thomlinson


"Gavin Ling" wrote:


Hi.

I need Excel to insert a date in a certain cell (F26) when another cell
is altered (C7). The trouble is that the date entered in F26 mustn't
change, it must always read as the date when C7 was altered.


I can't seem to make it work without the date constantly changing to
the new day's date.

Gavin


--
Gavin Ling
------------------------------------------------------------------------
Gavin Ling's Profile: http://www.excelforum.com/member.php...o&userid=30110
View this thread: http://www.excelforum.com/showthread...hreadid=512015




All times are GMT +1. The time now is 04:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com