+ Reply to Thread
Results 1 to 5 of 5

Msg box displays prematurely; not in sync with the output answer cell

  1. #1
    Registered User
    Join Date
    11-10-2011
    Location
    Chatsworth, California
    MS-Off Ver
    Excel 2010
    Posts
    41

    Msg box displays prematurely; not in sync with the output answer cell

    When the function executes the message box displays the answer in square inches as it should. Though, the output cell D16 (square feet) will not display the answer until AFTER the message box is turned off (or the OK button is pushed.) These two output sources are not in sync. I want the output cell (D16) and the message box to display their respective answers at the same time. How can I get the two in sync? (See attached workbook.) [I am using Windows XP; 32 bit and using Excel 2010]

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by BGiffin2004; 11-16-2011 at 12:10 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Msg box displays prematurely; not in sync with the output answer cell

    Hello BGiffin2004,

    The behaviour you are describing for a message box is normal. This action of not updating the worksheet or allowing the user to change the worksheet until the OK button clicked is known as modal operation.

    The only way to "sync" the operation would be to use a UserForm in place of the message box. A UserForm can be displayed modally or not. I have made the need changes to the attached workbook.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    11-10-2011
    Location
    Chatsworth, California
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Msg box displays prematurely; not in sync with the output answer cell

    A little late this; but I'm new. - Just got the heads-up on posting the link if I happened to cross-post this post. I posted it also on MREXCEL.COM @ http://www.mrexcel.com/forum/showthread.php?t=592247 This forum here is the original forum I posted to, and will refer readers at MrExcel.com to this site to reply here.
    Last edited by BGiffin2004; 11-15-2011 at 01:04 AM.

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Msg box displays prematurely; not in sync with the output answer cell

    Earlier when I saw this thread I had the same idea as Leith but I was using a textbox that I inactivated. Leith's approach is better.

    Now that I had some time to think about it, there is another simple approach (a worksheet_change).

    In a standard module:
    Please Login or Register  to view this content.
    In Sheet1's code:
    Please Login or Register  to view this content.
    Hope this helps.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  5. #5
    Registered User
    Join Date
    11-10-2011
    Location
    Chatsworth, California
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Msg box displays prematurely; not in sync with the output answer cell

    Yes it does help. Thanks so much for helping me out.
    Leith; thanks also!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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