I want to produce a sound or beep when the contents of a cell become a certain value,eg if h5 =10 then beep
I want to produce a sound or beep when the contents of a cell become a certain value,eg if h5 =10 then beep
Here's a sample:
http://www.geocities.com/smplprgrsrc...epOnChange.zip
"pytelium" <pytelium.1so52b_1122199501.773@excelforum-nospam.com> schreef in
bericht news:pytelium.1so52b_1122199501.773@excelforum-nospam.com...
>
> I want to produce a sound or beep when the contents of a cell become a
> certain value,eg if h5 =10 then beep
>
>
> --
> pytelium
> ------------------------------------------------------------------------
> pytelium's Profile:
> http://www.excelforum.com/member.php...o&userid=25521
> View this thread: http://www.excelforum.com/showthread...hreadid=389683
>
Option Explicit
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" _
(ByVal lpszName As String, _
hModule As Long, _
ByVal dwFlags As Long) As Long
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:H10")) Is Nothing Then
With Target
PlayWavFile "C:\Windows\Media\chimes.wav"
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
Public Function PlayWavFile(WavFile As String) As String
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
PlaySound WavFile, 0, SND_ASYNC Or SND_FILENAME
PlayWavFile = ""
End Function
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
--
HTH
RP
(remove nothere from the email address if mailing direct)
"pytelium" <pytelium.1so52b_1122199501.773@excelforum-nospam.com> wrote in
message news:pytelium.1so52b_1122199501.773@excelforum-nospam.com...
>
> I want to produce a sound or beep when the contents of a cell become a
> certain value,eg if h5 =10 then beep
>
>
> --
> pytelium
> ------------------------------------------------------------------------
> pytelium's Profile:
http://www.excelforum.com/member.php...o&userid=25521
> View this thread: http://www.excelforum.com/showthread...hreadid=389683
>
Thank you both,I will try them tomorrow
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks