ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Timer with Sheet Toggle Help (https://www.excelbanter.com/excel-programming/295004-excel-timer-sheet-toggle-help.html)

Tysone

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

TH[_3_]

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



TH[_3_]

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




Bob Phillips[_6_]

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




Tysone

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)


Bob Phillips[_6_]

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)




Tysone

Excel Timer with Sheet Toggle Help
 
Great - that link isn't exactly what I wanted, but I made it work.

Thanks

Tyson

(Tysone) wrote in message . com...
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)



All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com