#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Spreadsheet

I need to track information on a spreadsheet and need to know how long that
information has been lying there. Is there a timer or clock one can insert to
do this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Spreadsheet

you could use th eworksheet's CHANGE event to add a timestamp to mark when
the value was entered.
right click the sheet tab *& go to the code page, add thsi:

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
' check column B
If Target.Column = 2 Then
Target.Offset(0, -1).Value = Format(Now, "dd-mmm-yy hh:mm")
End If
End Sub

if you enter anything in column B it adds a timestamp to column A

"Robbie" wrote:

I need to track information on a spreadsheet and need to know how long that
information has been lying there. Is there a timer or clock one can insert to
do this.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Spreadsheet

The easiest way is to have an adjacent column that stores the time when
something is changed, along the lines of

Private Sub Worksheet_Change(ByVal Target As Range)
Static prevValue

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("K1:K34")) Is Nothing Then
With Target.Offset(0, 1)
.Value = Now
.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

RP
(remove nothere from the email address if mailing direct)


"Robbie" wrote in message
...
I need to track information on a spreadsheet and need to know how long

that
information has been lying there. Is there a timer or clock one can insert

to
do this.



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
link a local spreadsheet to a network shared spreadsheet Leo Setting up and Configuration of Excel 1 March 21st 08 10:37 AM
conversion of MS Works Spreadsheet to Excel 2002 Spreadsheet Kellie Excel Discussion (Misc queries) 1 March 24th 05 06:31 PM
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? oil_driller Excel Discussion (Misc queries) 1 February 8th 05 09:34 AM
How do I convert exel spreadsheet to works spreadsheet? tareco Excel Discussion (Misc queries) 3 December 27th 04 11:20 PM
How to open another Excel spreadsheet to copy data into current spreadsheet ? Ricky Pang Excel Programming 0 July 13th 03 01:59 PM


All times are GMT +1. The time now is 01:09 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"