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?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,128
Messages
5,835,564
Members
430,367
Latest member
glastonbury

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