Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Timer in Excel | Excel Discussion (Misc queries) | |||
Pop up timer for excel | Excel Discussion (Misc queries) | |||
EXCEL TIMER CONTROL | Links and Linking in Excel | |||
Stopping a Timer / Running a timer simultaneously on Excel | Excel Discussion (Misc queries) | |||
Excel functions?????????FIRST TIMER | Excel Programming |