Microsoft Excel Sound Alarms: Create an alarm and set it to ring

Microsoft Excel Sound Alarms: Create an alarm and set it to ring

Microsoft Excel has many built-in tools to allow you to automate conditional formatting. This includes changing the cell’s color depending on whether certain conditions have been met.

However, many don’t know that Excel can make Excel sound like a musical instrument by using Microsoft’s Visual Basic for Applications. This Excel tutorial will demonstrate how to set Excel up to trigger an alarm if a certain condition has been met.

Create and ring a sound alarm in microsoft excel

Excel: How to Ring an Alert

Excel must follow two steps to allow it to play the sound that is triggered by a trigger. To enable Excel to play this sound, first add the custom code. Next, tell Excel which event or value triggers the sound.

You must first create a brand new rule by using the following: Excel VBA macro. . Although this sounds confusing, it is not. You can simply copy the code below and change some basic parameters.

Excel: How do I create an alarm?

  1. Open your Excel spreadsheet.
  2. Press Alt+ + F11 Click here to view the pop-up Microsoft Visual Basic for Applications window.
  3. Click Insert > Module.
Ring an alarm in excel
  1. The following code should be entered:

Use MakeABeep() to create a String

Beep

MakeABeep = ‘”

End Function

Ring an alarm in excel
  1. Click Save.
Ring an alarm in excel
  1. In the Save as Type Select from drop-down menu Excel Macro-Enabled Workbook.
Ring an alarm in excel
  1. Type “=MakeABeep()” in any cell and hit the Enter key Enter. . Your code is working if you can hear the system making a sound.
Ring an alarm in excel

Excel: How do I trigger the alarm?

You will need to next add conditional formatting To the cell where you want to make a particular sound on a certain event. It will all depend on the event you wish to trigger. You might also need to learn how to use it various Excel formulas To make sure it works exactly how you intended.

Below is an example that shows how you can get A1’s cell to make a sound, if it hits 100:

  1. Choose an empty cell from your Excel spreadsheet.
  2. Type “=IF(A1>100, MakeABeep(),””)“and press Enter.
Ring an alarm in excel

System sounds will be played when the A1 value of the cell reaches 101.

How to make Excel play your custom Sound

Excel can be configured to use multiple sounds, rather than just one. By doing this, Excel can be set up to sound multiple custom sounds when certain conditions are met.

  1. Open your Excel file.
  2. Press Alt + F11 Microsoft VBA can be opened.
  3. Press Insert >> Module.
Get excel to play a custom sound
  1. Enter:

#If Win64 Then

Private Declare Function PtrSafe PlaySound Lib “winmm.dll”

Alias “PlaySoundA” (ByVal lpszName As String, _

ByVal hModule As LongPtr, ByVal dwFlags As Long) As Boolean

#Else

Private Declare Function PlaySound Library “winmm.dll” _

Alias “PlaySoundA” (ByVal lpszName As String, _

ByVal hModule As Long, ByVal dwFlags As Long) As Boolean

#End If

Const SND_SYNC = &H0

Const SND_ASYNC = &H1

Const SND_FILENAME = &H20000

Use Function AlarmSound() as String

Call PlaySound(“C:\Users\User\Downloads\sound.wav”, _

(0, SND_ASYNC OR SND_FILENAME)

AlarmSound = “”

End Function

Get excel to play a custom sound
  1. Replace “C:\Users\User\Downloads\sound.wav” with the location of the sound file that you would like to use. This information is available by opening the folder in File Explorer, Click the right-click icon in the address bar to select Copy address as text.
Get excel to play a custom sound
  1. Press Ctrl + S To save the file.
  2. In the Save as Type Select from drop-down or select Excel Macro-Enabled Workbook.
Get excel to play a custom sound
  1. Your conditional formatting equation can be added to every blank cell. You might use the following example:=IF(A1>100, AlarmSound(),””)“. If the A1 cell’s value reaches 100, it will sound an alarm.
Get excel to play a custom sound

Note: This template code uses “AlarmSound”, instead of “MakeABeep.” You can write both of these as you wish. If you want multiple alarms that ring under different circumstances, for example, “Alarm1”, “Alarm2,” etc.

Excel: What kind of alarms can you create?

Excel is an extremely powerful tool. It includes many formulas that you can use in order to make your data look exactly the way you want. Click the button to use these rules Home Tab and Click Conditional Formatting.

What kind of alarms can you create in excel?

Below are some examples of data conditions Excel could use to set up an alarm:

  1. If the value of another value (or a combination thereof) is greater, equal, less, or similar to it,
  2. If there is more than one cell,
  3. The cell can be used to refer to a specific date, such as a due or expiration date
  4. If%20the%20value%20is%20in%20a%20specific%20percentile%20(for%20example,%20the%20top%2010%%20or%20above%20average)
  5. You can use conditional formatting rules to make sure the cells are a certain color if they have been previously set up

Data Management has Never been simpler

Microsoft Office Excel excel is an extremely powerful and reliable data validation and analysis tool. It has been so for quite some time. Excel provides the right tools to make your Excel workbook easy to understand or to format cells so you know when certain conditions have been met.

Leave a Reply

Your email address will not be published. Required fields are marked *