Consulting

Results 1 to 3 of 3

Thread: is macro running?

  1. #1
    VBAX Tutor
    Joined
    Jan 2008
    Posts
    266
    Location

    is macro running?

    i have a button on the sheet that starts a macro.
    the problem is that you can press the button several times and the macro will run several times and make a big mess.
    how can i stop that?
    can i find out if the macro count_salary is running?

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    If you can press the button, the macro is not running.

    If re-running a routine will foul the data, you could either add a bit at the start of the macro to test if the sheet is OK to alter or you could have the user answer a "Do you want to do this?" MsgBox.

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Hide the button at the end of the macro.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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