Macros for alarm

AlyK

New Member
Joined
Jan 5, 2012
Messages
3
Hi all,

I just started learning macros a few days ago and I've got to use it in my project. I'm trying to create an alarm system using an audio alert. I've found a few examples online but I don't understand the coding language of excel. What I need is to have an alert from when my 'total left' is < 25. I've entered a VBA coding in my sheet, but it just doesn't work and I don't understand what is wrong. I'm really struggling to understand this, so really, any enlightenment one where I went wrong would be a great help.

All help is greatly appreciated, thank you! :)

http://www.mediafire.com/?9a2g383433cdt8a

Aly
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi Aly and welcome to the Board!

I couldn't test the API function you posted because it works only with Windows XP. What is your version?
Anyway, the following macros will make the computer beep whenever you select a forbidden value or enter one. It must be placed on the sheet code, not in a module.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("D:D")) Is Nothing Then
        If Target.Value < 25 And Target.Value <> "" Then Beep
    End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    If Not Intersect(Target, Range("D:D")) Is Nothing Then
        If Target.Value < 25 Then Beep
    End If
End Sub
 
Last edited:
Upvote 0
you could try Application.speach to have excel voice an alert.

Code:
Sub TALKTOME()
Application.Speech.Speak "ALERT!, ALERT!"
End Sub
 
Upvote 0
Hi Aly

What Excel version are you using?
API functions are more advanced stuff, as you informed being a novice, maybe it's a sound idea to postpone their use.

The speak suggestion was a good one, did you like it? Need help to implement?
 
Upvote 0
The below may be a bit more advanced than you are ready for but...

Generating an audio alert
http://www.tushar-mehta.com/publish_train/xl_vba_cases/TM_Audio_Alerts.htm

Hi all,

I just started learning macros a few days ago and I've got to use it in my project. I'm trying to create an alarm system using an audio alert. I've found a few examples online but I don't understand the coding language of excel. What I need is to have an alert from when my 'total left' is < 25. I've entered a VBA coding in my sheet, but it just doesn't work and I don't understand what is wrong. I'm really struggling to understand this, so really, any enlightenment one where I went wrong would be a great help.

All help is greatly appreciated, thank you! :)

http://www.mediafire.com/?9a2g383433cdt8a

Aly
 
Upvote 0
Hi Worf,

Sorry for the late reply, I'm using excel 2010! So sorry to have misunderstood what you were asking for. And thanks for the help guys! I'm going to try them out now! :D
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,217
Members
449,074
Latest member
cancansova

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
Back
Top