Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 170
Default Problem recording entry time

xecel 2007 on WindowsXP
I need to time stamp entries in a spreadsheet. I thought the NOW() function
would do teh trick, but alas, I was mistaken. In column "B" I used the
formula
=if(A#0, NOW(), "")
which worked great, until I moved to the next line and made an entry into
column A, that is when the both entries in column B were updated to the
current time.

Is there a way to record the time a cell changes from empty to non empty
status, without updating every other cell in the column? We are simply
attempting to automate a call log-- shouldn't be this difficult.

Anyone have a solution for my little mind twister today

Thanks in advance for the fantatsic help this forum provides
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Problem recording entry time

Hi,

To get a static time right click your worksheet, view code and paste this
code in. Any entry in column A makes column B populate with a static NOW

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Application.EnableEvents = False
With Target.Offset(, 1)
.Value = Now
.NumberFormat = ("dd/mm/yyyy hh:mm")
End With
Application.EnableEvents = True
End If
End Sub

Mike

"JR Hester" wrote:

xecel 2007 on WindowsXP
I need to time stamp entries in a spreadsheet. I thought the NOW() function
would do teh trick, but alas, I was mistaken. In column "B" I used the
formula
=if(A#0, NOW(), "")
which worked great, until I moved to the next line and made an entry into
column A, that is when the both entries in column B were updated to the
current time.

Is there a way to record the time a cell changes from empty to non empty
status, without updating every other cell in the column? We are simply
attempting to automate a call log-- shouldn't be this difficult.

Anyone have a solution for my little mind twister today

Thanks in advance for the fantatsic help this forum provides

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 170
Default Problem recording entry time

Thank you , that works just as we had hoped for.

"Mike H" wrote:

Hi,

To get a static time right click your worksheet, view code and paste this
code in. Any entry in column A makes column B populate with a static NOW

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Application.EnableEvents = False
With Target.Offset(, 1)
.Value = Now
.NumberFormat = ("dd/mm/yyyy hh:mm")
End With
Application.EnableEvents = True
End If
End Sub

Mike

"JR Hester" wrote:

xecel 2007 on WindowsXP
I need to time stamp entries in a spreadsheet. I thought the NOW() function
would do teh trick, but alas, I was mistaken. In column "B" I used the
formula
=if(A#0, NOW(), "")
which worked great, until I moved to the next line and made an entry into
column A, that is when the both entries in column B were updated to the
current time.

Is there a way to record the time a cell changes from empty to non empty
status, without updating every other cell in the column? We are simply
attempting to automate a call log-- shouldn't be this difficult.

Anyone have a solution for my little mind twister today

Thanks in advance for the fantatsic help this forum provides

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Problem recording entry time

Your welcome

"JR Hester" wrote:

Thank you , that works just as we had hoped for.

"Mike H" wrote:

Hi,

To get a static time right click your worksheet, view code and paste this
code in. Any entry in column A makes column B populate with a static NOW

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Application.EnableEvents = False
With Target.Offset(, 1)
.Value = Now
.NumberFormat = ("dd/mm/yyyy hh:mm")
End With
Application.EnableEvents = True
End If
End Sub

Mike

"JR Hester" wrote:

xecel 2007 on WindowsXP
I need to time stamp entries in a spreadsheet. I thought the NOW() function
would do teh trick, but alas, I was mistaken. In column "B" I used the
formula
=if(A#0, NOW(), "")
which worked great, until I moved to the next line and made an entry into
column A, that is when the both entries in column B were updated to the
current time.

Is there a way to record the time a cell changes from empty to non empty
status, without updating every other cell in the column? We are simply
attempting to automate a call log-- shouldn't be this difficult.

Anyone have a solution for my little mind twister today

Thanks in advance for the fantatsic help this forum provides

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 170
Default Problem recording entry time

Mike,

Thanks for that solution yesterday. Admittedly I am not macro literate at
this time. Now my assocaites need another version of that routine. They want
to add a second version in teh same worksheet that targets column G for data
entry and palce teh static NOW into column "F". I thought just making some
changes to teh code might get the results we were looking for. I tried
changing the offset to -1, 7 or even leaving at just 1, without any luck.

Here is the last code I tried, am I any where close or is this worksheet
change macro limited to one occurrence in a worksheet?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Application.EnableEvents = False
With Target.Offset(, 1)
..Value = Now
..NumberFormat = ("hh:mm:ss")
End With
Application.EnableEvents = True
End If
End Sub

Private Sub Worksheet_Change2(ByVal Target2 As Range)
If Target2.Cells.Count 1 Or IsEmpty(Target2) Then Exit Sub
If Not Intersect(Target2, Range("G:G")) Is Nothing Then
Application.EnableEvents = False
With Target2.Offset(, -1)
..Value = Now
..NumberFormat = ("hh:mm:ss")
End With
Application.EnableEvents = True
End If
End Sub

Thanks again for any guidance you can offer.

"Mike H" wrote:

Your welcome

"JR Hester" wrote:

Thank you , that works just as we had hoped for.

"Mike H" wrote:

Hi,

To get a static time right click your worksheet, view code and paste this
code in. Any entry in column A makes column B populate with a static NOW

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Application.EnableEvents = False
With Target.Offset(, 1)
.Value = Now
.NumberFormat = ("dd/mm/yyyy hh:mm")
End With
Application.EnableEvents = True
End If
End Sub

Mike

"JR Hester" wrote:

xecel 2007 on WindowsXP
I need to time stamp entries in a spreadsheet. I thought the NOW() function
would do teh trick, but alas, I was mistaken. In column "B" I used the
formula
=if(A#0, NOW(), "")
which worked great, until I moved to the next line and made an entry into
column A, that is when the both entries in column B were updated to the
current time.

Is there a way to record the time a cell changes from empty to non empty
status, without updating every other cell in the column? We are simply
attempting to automate a call log-- shouldn't be this difficult.

Anyone have a solution for my little mind twister today

Thanks in advance for the fantatsic help this forum provides

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
Recording elapsed time kap New Users to Excel 1 October 27th 06 01:58 AM
recording a data entry date Rusty 1i Excel Worksheet Functions 1 July 8th 06 06:18 PM
Macro recording problem. leats1 Excel Worksheet Functions 2 October 24th 05 10:54 PM
recording negative time james Excel Discussion (Misc queries) 3 April 15th 05 12:20 PM
Recording time in Excel Trish Hodge Excel Discussion (Misc queries) 1 February 2nd 05 08:33 PM


All times are GMT +1. The time now is 08:05 AM.

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"