+ Reply to Thread
Results 1 to 6 of 6

Exclude macros from triggering msgbox

  1. #1
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    91

    Exclude macros from triggering msgbox

    I have many formulas in my workbook and I don't want anyone writing over them. Normally they are in protected mode. Sometimes the sheets need to be unprotected leaving the cells with formulas vulnerable to write over by accident. I know how to have a msgbox pop up when a cell with a formula in it is selected. The problem is I have a button which runs several macros. I don't want any msgbox' to pop up when I run the macros. The only time I want the msgbox to appear is when a user unprotected the sheet or workbook and selects a cell with a formula in it. I hope this makes sense. Any help would be appreciated

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,494

    Re: Exclude macros from triggering msgbox

    Define a global Boolean variable. By default, it will have the value False. At the start of each of your macros, set the variable value to True, and at the end, reset it to False. Then use the variable to determine whether or not the MsgBox is displayed.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    91

    Re: Exclude macros from triggering msgbox

    Thanks Trevor, sounds like a great way to solve the problem. I'm not the greatest with excel so i'll search for examples of doing this. Any examples would be appreciated. Thanks again, Jim

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,494

    Re: Exclude macros from triggering msgbox

    You're welcome. Thanks for the rep.


    Please Login or Register  to view this content.


    Regards,TMS

  5. #5
    Registered User
    Join Date
    04-28-2014
    Location
    Florida
    MS-Off Ver
    Excel 2007, 2010, 2011 Mac. 2013,2016. I use 2011 and 2016 the most
    Posts
    91

    Re: Exclude macros from triggering msgbox

    Outstanding. exactly what i was looking for. Thanks again, Jim

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,494

    Re: Exclude macros from triggering msgbox

    You're welcome.

+ 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. Triggering Macros from Validation List
    By Pratster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-06-2010, 10:16 PM
  2. [SOLVED] Userform combo box triggering macros
    By michaelberrier in forum Excel General
    Replies: 6
    Last Post: 06-10-2006, 08:30 AM
  3. Triggering Macros
    By Sloth in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2006, 11:25 AM
  4. [SOLVED] triggering macros
    By gvm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2005, 12:05 PM
  5. Triggering an excel menu using macros
    By Sassy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-08-2005, 08:05 PM

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