+ Reply to Thread
Results 1 to 4 of 4

Activate Macro when time is below that in a different cell

  1. #1
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    2019
    Posts
    452

    Activate Macro when time is below that in a different cell

    Hi Guys,

    I have a macro (lifted from elsewhere) that will play a sound when a value below 10 is entered in the cell.

    I'd like to adapt it so when the value is equal to or below that of the value in a different cell it plays a wav file.

    The challenge is in cell Sheet2!K17 I have a time value 00:00:30 (displayed in mm:ss).

    What I want to do is when the cell value in Sheet1!J17 (which is a countdown timer) is equal to or below the value in cell Sheet2!K17 it plays the wav.

    Here's the code. What do I need to change to make that happen please.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Activate Macro when time is below that in a different cell

    Hi,

    Does J17 contain a formula or is it a literal value entered somehow?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    03-08-2011
    Location
    London
    MS-Off Ver
    2019
    Posts
    452

    Re: Activate Macro when time is below that in a different cell

    It does contain a formula. But I've been thinking I could introduce a control cell

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Activate Macro when time is below that in a different cell

    Because it is a formula, you need the Calculate event rather than the Change event

    Please Login or Register  to view this content.
    but you must appreciate that this will play the sound each time the workbook recalculates if the value is less than K12. If you only wish it to play once, you would require some sort of control variable, or value stored in a cell, to signal that it has already run once.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 11-06-2013, 02:56 AM
  2. activate a macro within a time limit
    By varshneybhasker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-09-2012, 05:45 AM
  3. Activate a macro when the value of a linked cell changes
    By Sarangsood in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-15-2011, 05:20 AM
  4. Replies: 5
    Last Post: 06-05-2007, 10:06 AM
  5. Click cell to activate macro
    By Bob in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-27-2006, 12:25 PM
  6. activate a cell value through a macro
    By TUNGANA KURMA RAJU in forum Excel General
    Replies: 1
    Last Post: 11-10-2005, 04:55 AM
  7. [SOLVED] Cell value Change Event - Need to activate macro
    By Listbox use in Excel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2005, 04:05 PM
  8. Cell Activate a Macro
    By icetrey in forum Excel - New Users/Basics
    Replies: 15
    Last Post: 03-17-2005, 06:44 AM

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