+ Reply to Thread
Results 1 to 12 of 12

Excel Beep

  1. #1
    Registered User
    Join Date
    07-28-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Excel Beep

    Hi All,
    I have been playing around with VB code to try and get a beep into my excel sheet.... With no luck

    What I'm trying to do is the following;

    When my if statement in column P outputs "OK" I want to be able to hear a "beep" from the computer and similarly when the same formula outputs "BAD" the computer gives me 2 beeps.

    Is this possible??

    Thanks in advance,
    River
    Last edited by rivergum; 07-31-2011 at 05:29 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Excel Beep

    Hi River
    Try
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    07-28-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Excel Beep

    Hi Jaslake,
    Cheers, thanks for that suggestion... However that was the bit I could actually get happening , it was more getting my IF statement code correct to read the "OK" or "BAD" out of my column P.

    Here is my code.... I'm just not exactly sure how to get it too look at P column only;


    Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("A1") = "OK" Then
    Beep
    Else
    Beep
    Application.Wait (Now + TimeValue("0:00:02"))
    Beep
    End If

    End Sub
    River
    Last edited by rivergum; 07-30-2011 at 09:47 PM.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Excel Beep

    Hi River

    You're new to the Forum but not that new. You've gotta use Code Tags around your code. Can't respond 'till you do.

  5. #5
    Registered User
    Join Date
    07-28-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Excel Beep

    Hi John,
    Sorry didn't know how to do that. All fixed up now.

    Cheers,
    River

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Excel Beep

    Hi River

    Well...you used Quote Tags not Code Tags. You can fix that. In the meantime you reference
    it was more getting my IF statement code correct to read the "OK" or "BAD" out of my column P.
    yet your code references
    Please Login or Register  to view this content.
    So what's your actual code and what column are we referencing?
    How does Column A (or Column P) get changed to "OK" or "Bad"...by user input? Change Event code is the correct approach but I'm not "seeing" what you want. A dummy file would be helpful.

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Excel Beep

    You might use this UDF.
    Put =MakeBeep(OR(P1="OK,P1="Bad"), 1+(P1="Bad"), "something") in a cell.

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  8. #8
    Registered User
    Join Date
    07-28-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Excel Beep

    Hi Guys,
    I see I have made a typo in my orignal post regarding the column I require...

    So as you can see via the attached workbook in column A is the results column of B and C using a simple IF statement.

    So the problem is that as you can see the beep or beep beep works in every column in the sheet not just in column A like I would like it to. So I'm not sure how to get the VB code to only look at column A and not the rest of the sheet.

    Please help!!

    Thanks Heaps.

    River
    Attached Files Attached Files

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel Beep

    You've used Quote Tags, not Code Tags
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  10. #10
    Registered User
    Join Date
    07-28-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Excel Beep

    Please Login or Register  to view this content.
    Hi Guys,
    I see I have made a typo in my orignal post regarding the column I require...

    So as you can see via the attached workbook in column A is the results column of B and C using a simple IF statement.

    So the problem is that as you can see the beep or beep beep works in every column in the sheet not just in column A like I would like it to. So I'm not sure how to get the VB code to only look at column A and not the rest of the sheet.

    Please help!!

    Thanks Heaps.

    River
    Attached Files Attached Files

  11. #11
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Excel Beep

    Your formula for A2 should probably be:
    =IF(AND(B2="OK",C2="OK"),"OK","BAD")
    and if so, change the others as well.

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    07-28-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Excel Beep

    Hi Kenneth,
    Thank you very much for your and everybody's help on this one!! Works perfect!!

    Cheers,
    River

+ 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