+ Reply to Thread
Results 1 to 4 of 4

sound

  1. #1
    Registered User
    Join Date
    07-23-2005
    Posts
    51

    sound

    I want to produce a sound or beep when the contents of a cell become a certain value,eg if h5 =10 then beep

  2. #2
    moi
    Guest

    Re: sound

    Here's a sample:
    http://www.geocities.com/smplprgrsrc...epOnChange.zip



    "pytelium" <[email protected]> schreef in
    bericht news:[email protected]...
    >
    > 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
    >




  3. #3
    Bob Phillips
    Guest

    Re: sound

    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" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




  4. #4
    Registered User
    Join Date
    07-23-2005
    Posts
    51

    sound

    Thank you both,I will try them tomorrow

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1