Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Excel Timer with Sheet Toggle Help

Here is my VB text:


Dim Nexttime

Sub Toggle_sheets()
Dim i
Nexttime = Now + TimeValue("00:00:30")
i = ActiveSheet.Index + 1
Range("b1").Select
ActiveCell.FormulaR1C1 = ""
If i 4 Then i = 1
ActiveWorkbook.Worksheets(i).Activate
Application.OnTime Nexttime, "Toggle_sheets"
End Sub


And what I want to add is a timer inside of this so that:

Range("b1").Select
ActiveCell.FormulaR1C1 = ""

would happen every 00:00:01

Can someone help me?

Thanks


Tyson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Excel Timer with Sheet Toggle Help

Try this link to an excellent description of OnTime and more.
Also try this from VBA HELP ANSWER WIZARD: Timer Function Example
You can also find the OnTime function in HELP. I think this may be the best
option so you can do other things in the worksheet while it updates every
second. Don't forget to Cancel the timer when in the Workbook_BeforeClose
event otherwise it will keep running! (Unless you quit Excel entirely.)

Terry

On 4/13/04 18:03, in article
, "Tysone"
wrote:

Here is my VB text:


Dim Nexttime

Sub Toggle_sheets()
Dim i
Nexttime = Now + TimeValue("00:00:30")
i = ActiveSheet.Index + 1
Range("b1").Select
ActiveCell.FormulaR1C1 = ""
If i 4 Then i = 1
ActiveWorkbook.Worksheets(i).Activate
Application.OnTime Nexttime, "Toggle_sheets"
End Sub


And what I want to add is a timer inside of this so that:

Range("b1").Select
ActiveCell.FormulaR1C1 = ""

would happen every 00:00:01

Can someone help me?

Thanks


Tyson


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Excel Timer with Sheet Toggle Help

Opps. Forgot the Link!

http://www.cpearson.com/excel/ontime.htm

On 4/13/04 19:06, in article , "TH"
wrote:

Try this link to an excellent description of OnTime and more.
Also try this from VBA HELP ANSWER WIZARD: Timer Function Example
You can also find the OnTime function in HELP. I think this may be the best
option so you can do other things in the worksheet while it updates every
second. Don't forget to Cancel the timer when in the Workbook_BeforeClose
event otherwise it will keep running! (Unless you quit Excel entirely.)

Terry

On 4/13/04 18:03, in article
, "Tysone"
wrote:

Here is my VB text:


Dim Nexttime

Sub Toggle_sheets()
Dim i
Nexttime = Now + TimeValue("00:00:30")
i = ActiveSheet.Index + 1
Range("b1").Select
ActiveCell.FormulaR1C1 = ""
If i 4 Then i = 1
ActiveWorkbook.Worksheets(i).Activate
Application.OnTime Nexttime, "Toggle_sheets"
End Sub


And what I want to add is a timer inside of this so that:

Range("b1").Select
ActiveCell.FormulaR1C1 = ""

would happen every 00:00:01

Can someone help me?

Thanks


Tyson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel Timer with Sheet Toggle Help

Can I ask why you want this, if it happens every second, who is going to
change in the interim?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Tysone" wrote in message
om...
Here is my VB text:


Dim Nexttime

Sub Toggle_sheets()
Dim i
Nexttime = Now + TimeValue("00:00:30")
i = ActiveSheet.Index + 1
Range("b1").Select
ActiveCell.FormulaR1C1 = ""
If i 4 Then i = 1
ActiveWorkbook.Worksheets(i).Activate
Application.OnTime Nexttime, "Toggle_sheets"
End Sub


And what I want to add is a timer inside of this so that:

Range("b1").Select
ActiveCell.FormulaR1C1 = ""

would happen every 00:00:01

Can someone help me?

Thanks


Tyson



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Excel Timer with Sheet Toggle Help

This is what it's for. I created a real time excel file that shows
all our sales people's revenue VS quota, that I display on a giant
plasma screen for them to look at. There will be no editing on this
workbook. All I do is take my laptop hook it up to the screen and let
it toggle. And why I want that action to take place every second is
because I have a timer on each page that I want to update every
second... Can someone help me make my formula happen??


"Bob Phillips" wrote in message ...
Can I ask why you want this, if it happens every second, who is going to
change in the interim?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel Timer with Sheet Toggle Help

How about something like

Sub Toggle_sheets()
Dim i As Long
Dim NextTime As Date
NextTime = Now + TimeValue("00:00:3")
'i = ActiveSheet.Index + 1
ResetCell

'If i 4 Then i = 1
'ActiveWorkbook.Worksheets(i).Activate
MsgBox "Toggle"
Application.OnTime NextTime, "Toggle_sheets"
End Sub

Sub ResetCell()
Dim NextSec
NextSec = Now + TimeValue("00:00:01")
'Range("B1").FormulaR1C1 = ""
MsgBox "hello"
Application.OnTime NextSec, "ResetCell"
End Sub

be interesting to see what happens to the stack though.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Tysone" wrote in message
om...
This is what it's for. I created a real time excel file that shows
all our sales people's revenue VS quota, that I display on a giant
plasma screen for them to look at. There will be no editing on this
workbook. All I do is take my laptop hook it up to the screen and let
it toggle. And why I want that action to take place every second is
because I have a timer on each page that I want to update every
second... Can someone help me make my formula happen??


"Bob Phillips" wrote in message

...
Can I ask why you want this, if it happens every second, who is going to
change in the interim?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)



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
Timer in Excel Gil Excel Discussion (Misc queries) 2 January 14th 10 12:57 PM
Pop up timer for excel jlclyde Excel Discussion (Misc queries) 1 August 31st 07 10:08 PM
EXCEL TIMER CONTROL Avinash Shukla Links and Linking in Excel 0 June 28th 07 11:38 AM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM
Excel functions?????????FIRST TIMER JC[_5_] Excel Programming 0 September 11th 03 07:52 PM


All times are GMT +1. The time now is 02:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"