ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Alarm (https://www.excelbanter.com/excel-worksheet-functions/249228-alarm.html)

Tomas

Alarm
 
Could someone help me, please?

Is there any function in excel which would be able to play some sound alarm
if the value in selected cell is for example higher than 10?

Thanks in advance

Jiri

L. Howard Kittle

Alarm
 
Try this in the sheet module. Not sure where I got it, I did not write it,
I just made small adjustments to it.. Change Range(A5) and cell value to
suit.

Private Declare Function Beep Lib _
"kernel32" (ByVal dwFreq As Long, _
ByVal dwDuration As Long) As Long

Private Sub Worksheet_Change(ByVal Target As Range)
Dim frequency As Long
Dim duration As Long
If Target < Range("A5") Then Exit Sub
If Target.Value 50 Then
frequency = 4160
duration = 1500
Call Beep(frequency, duration)
End If
End Sub

HTH
Regards,
Howard

"Tomas" wrote in message
...
Could someone help me, please?

Is there any function in excel which would be able to play some sound
alarm
if the value in selected cell is for example higher than 10?

Thanks in advance

Jiri




ryguy7272

Alarm
 
This should give you some ideas:
http://j-walk.com/ss/excel/tips/tip87.htm
http://www.vbaexpress.com/kb/getarticle.php?kb_id=161

HTH,
Ryan--

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Tomas" wrote:

Could someone help me, please?

Is there any function in excel which would be able to play some sound alarm
if the value in selected cell is for example higher than 10?

Thanks in advance

Jiri


L. Howard Kittle

Alarm
 
I offered a solution that would beep if a value over 50 was entered in a
specific cell. (Although I don't see it as of yet) I reread your post and
you want an alarm if the SELECTED cell value is over 10. Try this.

Option Explicit

Private Declare Function Beep Lib _
"kernel32" (ByVal dwFreq As Long, _
ByVal dwDuration As Long) As Long

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim frequency As Long
Dim duration As Long
If Target.Count < 1 Then Exit Sub
If Target.Value 10 Then
frequency = 4160
duration = 1500
Call Beep(frequency, duration)
End If
End Sub

HTH
Regards,
Howard

"Tomas" wrote in message
...
Could someone help me, please?

Is there any function in excel which would be able to play some sound
alarm
if the value in selected cell is for example higher than 10?

Thanks in advance

Jiri





All times are GMT +1. The time now is 12:10 PM.

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