Automatic Date?

Domigos

New Member
Joined
Mar 20, 2002
Messages
11
I am trying to find a way of automatically inserting a date when a second cell has been altered. For example A1 = blank, if I then put any entry in A2, I want to show the date in A1 that A2 was altered.

I have already used the IF function using the NOW() function as an argument - but of course the date always changes thereafter whenever the workbook is opened or recalculated, as the cell is constantly reflecting (correctly) the NOW() function.

I just want to know when a cell was changed - sounds too simple to be difficult but I can't find a way of doing it. Can anyone help me with this?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Create a macro that goes to your date cell A1 and enters =today() whenever a user types anything into A2.

Make sure to add another step in your macro to CopyPasteValues in the date cell so that the today formula is not there to update.

Finally, create a button called "datestamp" and place it next to A2; assign your datestamp macro to it - users should hit it after updating.

There may be better ways with better VBS coding, but this is a simple way that unfortunately depends on your user actually hitting the update button after entering data.
This message was edited by Duane on 2002-03-21 13:38
 
Upvote 0
Try this and see if it will work for you....

=if(isblank(a2),"",if(b2="",now(),b2))

Adjust cells to fit.............


Denny
 
Upvote 0
Thanks to you all for your efforts at solving this one - and I understand the approach that all of you have made, but I still have the problem.

Perhaps I was beig over-simplistic in my original description.

What I want to do is to have a list which automatically keeps a running total of a stock item ( I have already solved this part) but then I would like to have a column alongside the running total which tells me the date at which an adjustment to the stock level had been made. Is this any clearer?
 
Upvote 0
You could place a macro like this i the sheets own module. (rightclick on the sheettab, choose view code, and insert this code)
Please adjust Target.column yourself (here 2 = Column B)
Whenever a change is made to column B todays date is inserted in column C and it is not automatic updated.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then Target.Offset(0, 1) = Date
End Sub

regards Tommy
 
Upvote 0
Tommy,

What can I say? Your response works just perfectly - by adding additional lines of code, I can now format any columns on the same worksheet to behave in exactly the way I required - pure brilliance as far as I'm concerned.

I really do appreciate your help in solving this problem which, prior to this, I worried at for about three weeks!

Once again many thanks for sharing your undoubted talent and experience.

Richard
 
Upvote 0

Forum statistics

Threads
1,214,379
Messages
6,119,190
Members
448,874
Latest member
Lancelots

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top