ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How can I set an alarm Excel? (https://www.excelbanter.com/excel-discussion-misc-queries/253451-how-can-i-set-alarm-excel.html)

Annell

How can I set an alarm Excel?
 
I would like to set an audible alarm in Excel based on a cell value.

L. Howard Kittle

How can I set an alarm Excel?
 
Try this in the worksheet VBA editor. If the value of A5 is greater than 50
you get a beep.

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

"Annell" wrote in message
...
I would like to set an audible alarm in Excel based on a cell value.




Otto Moehrbach[_2_]

How can I set an alarm Excel?
 
Annell
This little macro will cause a beeping sound (one beep) if C5 is greater
than 5. Right-click your sheet tab and select View Code. Paste this macro
into that module. "X" out of the module to return to your sheet. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("C5")) Is Nothing Then _
If Target 5 Then Beep
End Sub

"Annell" wrote in message
...
I would like to set an audible alarm in Excel based on a cell value.




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

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