+ Reply to Thread
Results 1 to 5 of 5

If button clicked more than once a day

  1. #1
    Forum Contributor
    Join Date
    12-11-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    517

    If button clicked more than once a day

    Hi Everyone, i'm not sure if this is possible but i'm looking for a code where:

    If button is clicked more than once a day then do nothing
    else run code

    Thanks

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: If button clicked more than once a day

    Hi there,

    Try the following code and see if it does what you need:

    Please Login or Register  to view this content.
    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    06-25-2015
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    43

    Re: If button clicked more than once a day

    Hi,
    Your information is too simple to answer your question.


    If the button belongs to your ADDIN, you can do it in buttonclick callback.
    If the button belongs to EXCEL, you may advise an event to the button.

    You have to remember the datetime of last click. Maybe you also need button id as the click happens in different process in one day.

    Cheers,
    Last edited by neu_stone; 08-21-2015 at 04:26 PM.

  4. #4
    Forum Contributor
    Join Date
    12-11-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    517

    Re: If button clicked more than once a day

    Quote Originally Posted by Greg M View Post
    Hi there,

    Try the following code and see if it does what you need:

    Please Login or Register  to view this content.
    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Thanks Greg, this works great...however, how can this code run for specific button? i mean, i have 2 buttons on the sheet Button1 and Button2. Want this code to work for Button2 only.
    Thanks again!
    Last edited by biznez; 08-21-2015 at 05:02 PM.

  5. #5
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: If button clicked more than once a day

    Hi again,

    Many thanks for your feedback and also for the Reputation increase

    Assign the RunOnceDaily routine only to Button2 (left click on Button2 >> Assign Macro >> select RunOnceDaily from the dropdown list), and assign your other "multiple daily runs" routine to Button1. Anything else, feel free to shout!

    Best regards,

    Greg M

+ 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. [SOLVED] Using VBA to add 1 to an existing value when button is clicked
    By mdovey in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-02-2014, 06:38 PM
  2. [SOLVED] Change Button name when clicked
    By Bonnister in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2012, 07:00 AM
  3. Modifying a Macro Button to time stamp when the button was clicked.
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-22-2010, 04:46 PM
  4. Button Text Gets Smaller When Button Clicked On
    By googlebot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2009, 02:37 PM
  5. Button Clicked
    By boylejob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2007, 06:33 PM
  6. Which toolbar Button was clicked?
    By Mallycat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-04-2006, 12:34 AM
  7. Command Button does not re-set once clicked
    By Jurrasicway in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-09-2006, 09:25 AM
  8. [SOLVED] Do until button clicked
    By kaiser in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2005, 08:05 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