Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Timestamp for changes in any row of cells?

Hi,
I am trying to set up a timestamp at the end of a row of cells that will
enter the current date if any cell in the row is altered or updated. I can
only do it at present with one cell, if I use a range of cells the formula
doesn't work, not sure why. The formula I use is
=IF(R4="","",IF(T4="",NOW(),T4)) If I change the R4 to A4:R4 I get a wrong
#Value.
I'm running Office Pro Excel 2003 edition with SP3.

Thanks for any help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Timestamp for changes in any row of cells?


Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:R" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target

Me.Cells(.Row, "S").Value = Now
Me.Cells(.Row, "S").NumberFormat = "dd mmm yyyy hh:mm:Ss"
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Fatwilly" wrote in message
...
Hi,
I am trying to set up a timestamp at the end of a row of cells that will
enter the current date if any cell in the row is altered or updated. I can
only do it at present with one cell, if I use a range of cells the formula
doesn't work, not sure why. The formula I use is
=IF(R4="","",IF(T4="",NOW(),T4)) If I change the R4 to A4:R4 I get a wrong
#Value.
I'm running Office Pro Excel 2003 edition with SP3.

Thanks for any help.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Timestamp for changes in any row of cells?

Many thanks Bob it work a treat, great job.
regards
Fatwilly

"Bob Phillips" wrote:


Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:R" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target

Me.Cells(.Row, "S").Value = Now
Me.Cells(.Row, "S").NumberFormat = "dd mmm yyyy hh:mm:Ss"
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Fatwilly" wrote in message
...
Hi,
I am trying to set up a timestamp at the end of a row of cells that will
enter the current date if any cell in the row is altered or updated. I can
only do it at present with one cell, if I use a range of cells the formula
doesn't work, not sure why. The formula I use is
=IF(R4="","",IF(T4="",NOW(),T4)) If I change the R4 to A4:R4 I get a wrong
#Value.
I'm running Office Pro Excel 2003 edition with SP3.

Thanks for any help.




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
Timestamp juanpablo Excel Discussion (Misc queries) 3 November 2nd 07 01:55 PM
Timestamp ? elroyerni Excel Discussion (Misc queries) 2 June 1st 07 12:07 AM
Timestamp PS Excel Discussion (Misc queries) 2 January 10th 07 02:21 PM
Timestamp Sher Excel Discussion (Misc queries) 2 November 3rd 06 04:31 PM
Now as timestamp Lp12 Excel Worksheet Functions 5 August 13th 06 11:32 AM


All times are GMT +1. The time now is 06:21 PM.

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"