+ Reply to Thread
Results 1 to 7 of 7

only display a messagebox when the sheet is activated through user, not macro

  1. #1
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    only display a messagebox when the sheet is activated through user, not macro

    hello.

    I have this code for every workbook once it becomes the active workbook:
    Please Login or Register  to view this content.
    Also, when I run macros that add to these sheets, I have the worksheet that it is added to activated.

    Is there a way to only display that message box if the user is clicking between sheets but not when the macro is writing to the sheet?


    Or to at least have the message pop up after the userform has been closed?

    Thanks

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: only display a messagebox when the sheet is activated through user, not macro

    you can usually avoid activating sheets to process them in code but if you need to then use
    Please Login or Register  to view this content.
    to avoid the messages
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: only display a messagebox when the sheet is activated through user, not macro

    thanks joseph,

    I will have to try this in a few hours for I have ran out of time in the office. I will let you know if there are any complications!

  4. #4
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: only display a messagebox when the sheet is activated through user, not macro

    Hi josephp,

    I used that, and it still showed the message.

    here is the code I tried it in:

    Please Login or Register  to view this content.
    and here is the code that is using the event that I want to hide:
    Please Login or Register  to view this content.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: only display a messagebox when the sheet is activated through user, not macro

    you put it in the wrong place-you have another
    Please Login or Register  to view this content.
    before the last one

  6. #6
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: only display a messagebox when the sheet is activated through user, not macro

    oh wow! didn't even see that!

  7. #7
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: only display a messagebox when the sheet is activated through user, not macro

    It works!! thanks so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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