LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Richard
 
Posts: n/a
Default Automatically running code

The code works fine, but how and where do you put it for it to start
automatically and run continually. I have it in a Module but I have to
manually go in and run it
from there. If I put it in Private Sub Workbook_Open() it only shows the
current time when opened and does not run continually.

Sub clock()
If ThisWorkbook.Worksheets(1).Range("C2").Value = "X" Then Exit Sub
ThisWorkbook.Worksheets(1).Range("G2").Value = Format(Now, "hh:mm:ss AM/PM")
Application.OnTime Now + TimeSerial(0, 0, 60), "clock"
End Sub
Thanks in Advance!


 
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
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Running a Macro automatically from Excel Brakeshoe Excel Worksheet Functions 1 July 13th 05 11:23 PM
automatically insert town name after entering zip code accessnovice Excel Discussion (Misc queries) 2 July 12th 05 10:01 PM
Error trapped only while stepping through the code - Not triggered when run Jeff Excel Discussion (Misc queries) 7 March 7th 05 06:29 PM


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