Alarm when certain condition is satisfied

Santosh20061988

New Member
Joined
Aug 18, 2010
Messages
8
Hi,

I am really unable to find out a way where I can create a sound like alarm when a certain condition is satisfied in a cell.

The scenario is like this: I have formated a cell like this, it automatically displays the time left to complete a task. I want the cell to give me a reminder or a alarm when the value in the cell falls down to certain limit ( ie 15 minutes).

Thanks in advance if you can help me out on this.
Thanks
Santosh
 

Some videos you may like

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

bertie

Well-known Member
Joined
Jun 12, 2009
Messages
1,869
Hi Santosh and welcome to the board.

To play simple sounds like "beep" then, assuming your time is in cell A1:
Code:
If Range("A1").value = "00:15:00" then beep

-------------------------------
I you have an "Alarm" sound file you want to play, you can find a Microsoft article on how to do so here:
http://support.microsoft.com/kb/158140

------------------------------
You can also use the built in Excel feature to speak out a warning:
To test

You may need speakers for this.
Open a new Excel Workbook.
Press Alt+F11.
Double click on the Sheet1 module in the Project Window, left hand side.
Copy an paste the code below.

In Sheet1 "A1" enter test data:
00:15:01
00:15:00
The second one wil trigger the macro.

Code:
[COLOR=darkblue]Private[/COLOR] [COLOR=darkblue]Sub[/COLOR] Worksheet_Change([COLOR=darkblue]ByVal[/COLOR] Target [COLOR=darkblue]As[/COLOR] Range)
   [COLOR=darkblue]Dim[/COLOR] myMins [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]Integer[/COLOR]
   [COLOR=darkblue]Dim[/COLOR] mySecs [COLOR=darkblue]As[/COLOR] [COLOR=darkblue]Integer[/COLOR]
 
   [COLOR=darkblue]If[/COLOR] Target.Address <> "$A$1" [COLOR=darkblue]Then[/COLOR] [COLOR=darkblue]Exit[/COLOR] [COLOR=darkblue]Sub[/COLOR]
 
   myMins = Minute(Target.Value)
   mySecs = Second(Target.Value)
 
   [COLOR=darkblue]If[/COLOR] myMins = 15 And mySecs = 0 Then _
      [COLOR=red]Application.Speech.Speak (myMins & " minutes to go.")[/COLOR]
[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Sub[/COLOR]

I hope this gives you enough ideas to help solve your problem.

Bertie
 

Watch MrExcel Video

Forum statistics

Threads
1,122,837
Messages
5,598,379
Members
414,234
Latest member
grlevesq

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top