+ Reply to Thread
Results 1 to 7 of 7

Is it possible to place a Sound Alert like Conditional Formating

  1. #1
    Registered User
    Join Date
    05-30-2006
    Posts
    18

    Is it possible to place a Sound Alert like Conditional Formating

    hi guys,


    is it possible to place a alert just like conditional formating, where we can change the color of the Cell????????


    Say cell value is 98, and a wud like to reciev a sound alert wen its 100. not the windows slow sound, but a sound of my choice?????????????



    Thanks in advance

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Ronald_peterson,

    Yes you can play the sound of your choosing based on a cell's value changing. As for the color change that is isn't so simple, and would require some very advanced programming.

    First add a Standard VBA Module to your Workbook. Copy the macro code below and paste it into the module. Next follow the directions to insert the conditions checking into the Worksheet_Change event. You can add the sound file names you want to use in the macro. The macro plays a sound when any cell's value equals 100.

    Sound Macro Code:
    Please Login or Register  to view this content.
    Condition Checking Code:
    Please Login or Register  to view this content.
    To install the Worksheet_Change() code:
    1) Copy the code using CTRL+C.
    2) Right Click on the Worksheet tab of the worksheet the macro will run on.
    3) Select "View Code" from the pop up menu.
    4) Paste the macro event code using CTRL+V.
    5) Save the code using CTRL+S.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    05-30-2006
    Posts
    18
    thanks a lot for ur reply Leith,


    Will try it now.
    Last edited by shg; 12-07-2008 at 07:22 PM. Reason: deleted spurious quote

  4. #4
    Registered User
    Join Date
    05-30-2006
    Posts
    18
    hey Leith,

    its rockin. Thanks again,


    just one request, just like conditnal formatin can be done with a single row or column or a few cells??
    Is it possible, to create an alert with different cell values??


    Thanks in advance
    Last edited by shg; 12-07-2008 at 07:23 PM. Reason: deleted spurious quote

  5. #5
    Registered User
    Join Date
    12-07-2008
    Location
    Minnesota
    Posts
    5
    I get an compile error whenever a value changes and then the code highlights yellow "Private Sub Worksheet_Change(ByVal Target As Range)" Maybe I'm using the wrong code but all I want is the value in c4 to give me and alert when the value is >=1000 or <=-1000.

    Any help would be more then appreciated.

    Regards,

    Kyle G.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello ronald_peterson,

    Here a few examples. Multiple cells can be tested, but the code is more complex. These examples apply to a single cell for simplicity.

    Code for any single cell in Column "A" and value = 100
    Please Login or Register  to view this content.
    Code for any single cell in Mutliple Columns "A:C" and value = 100
    Please Login or Register  to view this content.
    Code for any single cell in Row 2 and a value of 100...
    Please Login or Register  to view this content.
    Code for any single cell in Rows 2 to 10 and a value of 100...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  7. #7
    Registered User
    Join Date
    01-23-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Is it possible to place a Sound Alert like Conditional Formating

    Quote Originally Posted by Leith Ross View Post
    Hello Ronald_peterson,

    Yes you can play the sound of your choosing based on a cell's value changing. As for the color change that is isn't so simple, and would require some very advanced programming.

    First add a Standard VBA Module to your Workbook. Copy the macro code below and paste it into the module. Next follow the directions to insert the conditions checking into the Worksheet_Change event. You can add the sound file names you want to use in the macro. The macro plays a sound when any cell's value equals 100.

    Sound Macro Code:
    Please Login or Register  to view this content.
    Condition Checking Code:
    Please Login or Register  to view this content.
    To install the Worksheet_Change() code:
    1) Copy the code using CTRL+C.
    2) Right Click on the Worksheet tab of the worksheet the macro will run on.
    3) Select "View Code" from the pop up menu.
    4) Paste the macro event code using CTRL+V.
    5) Save the code using CTRL+S.

    Sincerely,
    Leith Ross
    HI Leith... When I try running the macro it gives me the following error....""Only comments may appear after END Sub, End Function, or End Property"" and it highlights..
    Private Declare Function apiPlaySound _
    Lib "winmm.dll" _
    Alias "PlaySoundA" _
    (ByVal lpszName As String, _
    ByVal hModule As Long, _
    ByVal dwFlags As Long) As Boolean

    Can you please help me with this.. Thanks

+ 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