View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Time Time is offline
external usenet poster
 
Posts: 9
Default Time Stamping A Cell

Does that code also work for shared workbooks? I am trying to establish a
workbook where people enter there initials into a cell (ex. Cell A1 at
8:35am), and I would like to have it also reflected on my computer as 8:35am
when I hit save to update the changes. Thanks again!!

"Gord Dibben" wrote:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in any cell in Col C
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 3 Then

'change line above to line below if want a range in C
'If Not Application.Intersect(Range("C1:C20"), Target) Is Nothing Then

n = Target.Row
If Excel.Range("C" & n).Value < "" Then
Excel.Range("D" & n).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click the sheet tab and "View Code".

Copy/paste the code into that sheet module.


Gord Dibben MS Excel MVP

On Wed, 7 Mar 2007 09:08:51 -0800, Time wrote:

Hello,

WOuld anyone be able to help me out with an EXCEL question? I was wondering
if it is at all possible to establish a relationship between cells? Lets say
if cell C4 was filled in at 830am, I want cell D4 to reflect the time it was
filled in.