Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cell update formula

Hi

Does anyone know of a formula for Excel 2003 that will stamp the date & time
in a particular cell if anything in that row has changed?

Many thanks

Neil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Cell update formula

Hi there,

If you want to do this for a single sheet, add the following to the specific
Sheet object (ie not a separate module):

Private Sub Worksheet_Change(ByVal Target As Range)
Dim iRow As Integer
iRow = Target.Row
Cells(iRow, 1).Value = Now()
End Sub


....or, if you want it to effect the whole workbook then add this to the
Workbook object:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim iRow As Integer
iRow = Target.Row
Cells(iRow, 1).Value = Now()
End Sub


Basically, when the change event fires 'Target' becomes a range from which
you can check the row number. You then use that in the cell address (Row x,
Column 1) to place the date and time.

Hope that helps.

Best regards

John

"CDDAH NHS" wrote in message
...
Hi

Does anyone know of a formula for Excel 2003 that will stamp the date &
time
in a particular cell if anything in that row has changed?

Many thanks

Neil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cell update formula

Excellent, thanks John!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Cell update formula

Be aware that the Now() will recalculate each time you open the file whether
there is a change or not.

"CDDAH NHS" wrote:

Excellent, thanks John!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Cell update formula

Good point.

You might want to change that to:

Cells(iRow, 1).Value = CStr(Now())

Best regards

John


"JLGWhiz" wrote in message
...
Be aware that the Now() will recalculate each time you open the file
whether
there is a change or not.

"CDDAH NHS" wrote:

Excellent, thanks John!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Cell update formula

=NOW() will recalculate, but what john is doing dose not put in a formula
it puts in the date and time so it will not recalculate
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"JLGWhiz" wrote in message
...
Be aware that the Now() will recalculate each time you open the file

whether
there is a change or not.

"CDDAH NHS" wrote:

Excellent, thanks John!



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
update formula in column when another cell formula is changed Susanelm Excel Worksheet Functions 1 June 9th 08 05:06 PM
Update Excel cell in formula not refreshing answer cell Johnny Excel Discussion (Misc queries) 2 June 21st 07 05:49 AM
update formula cell Carrguy Excel Programming 1 August 3rd 06 10:52 PM
What formula will get a cell to update when the month changes lesterslamb Excel Worksheet Functions 2 May 25th 06 11:15 PM
Update cell reference within a formula Jean Excel Discussion (Misc queries) 1 February 4th 06 11:57 PM


All times are GMT +1. The time now is 03:29 PM.

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

About Us

"It's about Microsoft Excel"