Beep macro

thunderfoot

Board Regular
Joined
May 28, 2004
Messages
229
I have a worksheet in a file (linked to another EXCEL file which is constantly updated with 'live' information) that will operate a Module Macro routine when a button is pressed.

But before the button is pressed I want to be able to set-up an Audible 'BEEP' when one cell exceeds the value in another cell. This is currently done with a Visual Trigger (i.e. Conditional Formatting).

Is there a way to set-up a macro or something that runs constantly to identify (Audibly) when the value in one cell exceeds the value in another cell? Whilst this is running I still need to be able to invoke my Module Macro using a button.

Not sure how Worksheet/Workbook modules operate and how they are invoked, but is this the way to do it? If so, how?
 

Some videos you may like

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
Seems Ok. Here is a test ......................

In the code module for the sheet (right click tab/view code)
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Range("B1").Value > Range("A1").Value Then
        Beep
        MsgBox ("Value exceeeded")
    End If
End Sub
In a ordinary code module :-
Code:
Sub test()
    Range("A1").Value = 5
    For n = 1 To 10
        Range("B1").Value = n
    Next
End Sub
 

easan

New Member
Joined
Nov 18, 2005
Messages
3
beep

:(

i am unable to get my spreadsheet to beep, Brian. Since this is the very first time i'm using a macro, i imagine i'm doing what your signature says "starting in the wrong place".

Any trick to getting my spreadsheet to beep. Any trick to a new macro ?
 

BrianB

Well-known Member
Joined
Feb 17, 2003
Messages
8,127
It may be a Windows system problem. Although it is not a problem, I notice that in my posh XP setup at home the beeps come through the sound card rather than internal speaker. Try the simple macro below to see if any sound is produced. Also check/test Sounds in Windows Control Panel :-

Code:
Sub Test()
    Beep
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,118,083
Messages
5,570,122
Members
412,305
Latest member
Mozz
Top