#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Alarm Timer

Looking to have a timer set off an alarm at 15 minute intervals as in Visual
Basic.net
Dim WithEvernts Timer1 as Timer

Dim TimeRemaining as Integer ==15*60

Private Sub Worksheet_Open
Timer1.Interval=5000
Timer1 Enabled=True
Timer1.Start() ' this does not work in Excel but does in VB.net
end sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick

TimeRemaining=TimeRemaining-5
If timeRemaing =0 then
....
Enact Alarm
....
TimeRemaining=15*60
End if
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Alarm Timer

In Excel VBA, you can use the OnTime method. See
www.cpearson.com/excel/OnTime.aspx for details and example code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Philosophaie" wrote in message
...
Looking to have a timer set off an alarm at 15 minute intervals as in
Visual
Basic.net
Dim WithEvernts Timer1 as Timer

Dim TimeRemaining as Integer ==15*60

Private Sub Worksheet_Open
Timer1.Interval=5000
Timer1 Enabled=True
Timer1.Start() ' this does not work in Excel but does in VB.net
end sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick

TimeRemaining=TimeRemaining-5
If timeRemaing =0 then
...
Enact Alarm
...
TimeRemaining=15*60
End if
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Alarm Timer

Looking to make something flash on, off and recycle. Would nesting two
Application.OnTime functions?

"Chip Pearson" wrote:

In Excel VBA, you can use the OnTime method. See
www.cpearson.com/excel/OnTime.aspx for details and example code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Philosophaie" wrote in message
...
Looking to have a timer set off an alarm at 15 minute intervals as in
Visual
Basic.net
Dim WithEvernts Timer1 as Timer

Dim TimeRemaining as Integer ==15*60

Private Sub Worksheet_Open
Timer1.Interval=5000
Timer1 Enabled=True
Timer1.Start() ' this does not work in Excel but does in VB.net
end sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick

TimeRemaining=TimeRemaining-5
If timeRemaing =0 then
...
Enact Alarm
...
TimeRemaining=15*60
End if
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Alarm Timer

You could adapt the code for blinking text at
http://www.cpearson.com/excel/BlinkingText.aspx .


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Philosophaie" wrote in message
...
Looking to make something flash on, off and recycle. Would nesting two
Application.OnTime functions?

"Chip Pearson" wrote:

In Excel VBA, you can use the OnTime method. See
www.cpearson.com/excel/OnTime.aspx for details and example code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Philosophaie" wrote in message
...
Looking to have a timer set off an alarm at 15 minute intervals as in
Visual
Basic.net
Dim WithEvernts Timer1 as Timer

Dim TimeRemaining as Integer ==15*60

Private Sub Worksheet_Open
Timer1.Interval=5000
Timer1 Enabled=True
Timer1.Start() ' this does not work in Excel but does in VB.net
end sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick

TimeRemaining=TimeRemaining-5
If timeRemaing =0 then
...
Enact Alarm
...
TimeRemaining=15*60
End if
End Sub



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
Alarm Tomas Excel Worksheet Functions 3 November 24th 09 12:15 AM
FLASH ALARM osama amer Excel Discussion (Misc queries) 1 August 28th 06 12:10 PM
Alarm Manthony Excel Programming 0 June 6th 06 03:46 PM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM
Timer Alarm jimbo Excel Programming 6 March 28th 05 08:02 PM


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