A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro for Time Recording



 
 
Thread Tools Display Modes
  #1  
Old May 1st, 2010, 04:25 AM posted to microsoft.public.excel.worksheet.functions
Karim
external usenet poster
 
Posts: 68
Default Macro for Time Recording

hi,

I want to record current time into cell(A2) when cell (A1) does contain
value with macro.
I want to record it automaticaly without using any shortkey or tab,

Please help.


  #2  
Old May 1st, 2010, 04:31 AM posted to microsoft.public.excel.worksheet.functions
ozgrid.com
external usenet poster
 
Posts: 328
Default Macro for Time Recording

If Range("A1") val Then Range("A2")=Time


--
Regards
Dave Hawley
www.ozgrid.com
"karim" wrote in message
...
hi,

I want to record current time into cell(A2) when cell (A1) does contain
value with macro.
I want to record it automaticaly without using any shortkey or tab,

Please help.



  #3  
Old May 1st, 2010, 04:53 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Macro for Time Recording

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Me.Range("A1").Value "" Then
Me.Range("A2").Value = Format(Now, "hh:mm:ss")
End If
enditall:
Application.EnableEvents = True
End Sub

Placed in the worksheet module.


Gord Dibben MS Excel MVP

On Fri, 30 Apr 2010 20:25:01 -0700, karim
wrote:

hi,

I want to record current time into cell(A2) when cell (A1) does contain
value with macro.
I want to record it automaticaly without using any shortkey or tab,

Please help.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:41 AM.


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