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

I'm stumped. Anyone know how I might trigger a sound alarm
when a cell reaches a certain time?

I have estimated times in one column. The next column I have actual
time. The third column I have column 2 minus column 1. I would
also like excel to trigger an alarm sound if the cell in column 3
is greater than "0". (in other words if the estimated times are
exceeded)

Is this possible?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Timer Alarm

Something like this

Private Sub Worksheet_Calculate()
Dim cell As Range

On Error GoTo ws_exit:
Application.EnableEvents = False
For Each cell In Columns("C:C")
If cell.value 0 Then
MsgBox "done"
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"jimbo" wrote in message
ups.com...
I'm stumped. Anyone know how I might trigger a sound alarm
when a cell reaches a certain time?

I have estimated times in one column. The next column I have actual
time. The third column I have column 2 minus column 1. I would
also like excel to trigger an alarm sound if the cell in column 3
is greater than "0". (in other words if the estimated times are
exceeded)

Is this possible?



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

I guess a msgbox pops up with a sound, probably wanted
a wave file though. Times done in Excel are usually a
big waste of a processor.

For playing a .wav file see
' Tip 59 Playing Sound From Excel
' http://www.j-walk.com/ss/excel/tips/tip59.htm

Option Explicit
Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
'your own subroutine can be called from a worksheet event macro
Sub Double_beep()
Call sndPlaySound32("c:\i386\ringout.wav", 0)
End Sub

' Example of an Event Macro -- you will need to make playvalue100 in
' a regular module
' Option Explicit
' Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' If Target.Address(0, 0) = "A1" And Target.Value = 100 Then
' playvalue100
' End If
' End Sub

An external timer, or a timer in another application would probably
better, unless you are triggering the start of the timer on an Excel Event.

Timer Wizard - freeware alarm eggtimer software for windows, allows
you to easily and quickly set a reminder for an event in the future. You
can choose how you wish to be alerted.
http://www.siliconmachines.net/timerwiz/index.htm

might find this interesting if you want to play every sound onyou system someday.
http://www.mvps.org/dmcritchie/excel/code/beeps.txt

HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm
"Bob Phillips" wrote ...
Something like this

Private Sub Worksheet_Calculate()
Dim cell As Range

On Error GoTo ws_exit:
Application.EnableEvents = False
For Each cell In Columns("C:C")
If cell.value 0 Then
MsgBox "done"
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


"jimbo" wrote in message
ups.com...
I'm stumped. Anyone know how I might trigger a sound alarm
when a cell reaches a certain time?

I have estimated times in one column. The next column I have actual
time. The third column I have column 2 minus column 1. I would
also like excel to trigger an alarm sound if the cell in column 3
is greater than "0". (in other words if the estimated times are
exceeded)

Is this possible?





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

That was my laziness Dave, I just tried to show the principle, and leave the
rest to the OP.

Bob

"David McRitchie" wrote in message
...
I guess a msgbox pops up with a sound, probably wanted
a wave file though. Times done in Excel are usually a
big waste of a processor.

For playing a .wav file see
' Tip 59 Playing Sound From Excel
' http://www.j-walk.com/ss/excel/tips/tip59.htm

Option Explicit
Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
'your own subroutine can be called from a worksheet event macro
Sub Double_beep()
Call sndPlaySound32("c:\i386\ringout.wav", 0)
End Sub

' Example of an Event Macro -- you will need to make playvalue100 in
' a regular module
' Option Explicit
' Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' If Target.Address(0, 0) = "A1" And Target.Value = 100 Then
' playvalue100
' End If
' End Sub

An external timer, or a timer in another application would probably
better, unless you are triggering the start of the timer on an Excel

Event.

Timer Wizard - freeware alarm eggtimer software for windows, allows
you to easily and quickly set a reminder for an event in the future. You
can choose how you wish to be alerted.
http://www.siliconmachines.net/timerwiz/index.htm

might find this interesting if you want to play every sound onyou system

someday.
http://www.mvps.org/dmcritchie/excel/code/beeps.txt

HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm
"Bob Phillips" wrote ...
Something like this

Private Sub Worksheet_Calculate()
Dim cell As Range

On Error GoTo ws_exit:
Application.EnableEvents = False
For Each cell In Columns("C:C")
If cell.value 0 Then
MsgBox "done"
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


"jimbo" wrote in message
ups.com...
I'm stumped. Anyone know how I might trigger a sound alarm
when a cell reaches a certain time?

I have estimated times in one column. The next column I have actual
time. The third column I have column 2 minus column 1. I would
also like excel to trigger an alarm sound if the cell in column 3
is greater than "0". (in other words if the estimated times are
exceeded)

Is this possible?







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

Hi Bob,
You showed an example of the Calculate Event to show
how to test, and that is more important than the wave file.
And I hadn't really noticed it was entire columns to be checked
not just one cell. So egg timer is out.

"Bob Phillips" wrote ...
That was my laziness Dave, I just tried to show the principle,
and leave the rest to the OP.





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


David McRitchie wrote:
Hi Bob,
You showed an example of the Calculate Event to show
how to test, and that is more important than the wave file.
And I hadn't really noticed it was entire columns to be checked
not just one cell. So egg timer is out.

"Bob Phillips" wrote ...
That was my laziness Dave, I just tried to show the principle,
and leave the rest to the OP.


Thanks so much guys. I've decided to change things around
a bit. I will just use one cell at a time. As it is, I use
autocomplete...
10m to become 10 minutes which currently displays as 12:10:00 AM.
20m would be 20 minutes displaying 12:20:00 AM and so on (I format
these as 10:00 and 20:00) I'm probably doing everything the hard way.
But what I want to do now is have the timer go off and beep in 10
minutes from the starting point where I input the 10m or 20m. I'm
probably a knothead for trying it this way, Any help appreciated

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


David McRitchie wrote:
Hi Bob,
You showed an example of the Calculate Event to show
how to test, and that is more important than the wave file.
And I hadn't really noticed it was entire columns to be checked
not just one cell. So egg timer is out.

"Bob Phillips" wrote ...
That was my laziness Dave, I just tried to show the principle,
and leave the rest to the OP.


Thanks so much guys. I've decided to change things around
a bit. I will just use one cell at a time. As it is, I use
autocomplete...
10m to become 10 minutes which currently displays as 12:10:00 AM.
20m would be 20 minutes displaying 12:20:00 AM and so on (I format
these as 10:00 and 20:00) I'm probably doing everything the hard way.
But what I want to do now is have the timer go off and beep in 10
minutes from the starting point where I input the 10m or 20m. I'm
probably a knothead for trying it this way, Any help appreciated

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
How can I set an alarm Excel? Annell Excel Discussion (Misc queries) 2 January 14th 10 11:31 PM
Alarm Tomas Excel Worksheet Functions 3 November 24th 09 12:15 AM
How to set an alarm in excel... Fuzzy Excel Discussion (Misc queries) 1 February 12th 09 07:39 AM
FLASH ALARM osama amer Excel Discussion (Misc queries) 0 August 28th 06 10:30 AM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM


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