+ Reply to Thread
Results 1 to 7 of 7

Msg box response is ignored

  1. #1
    Registered User
    Join Date
    04-26-2009
    Location
    Norfolk
    MS-Off Ver
    Excel 2003
    Posts
    9

    Msg box response is ignored

    Hello,

    I am trying to achieve a response from a msgbox which will either continue with the sub or exit. I think my code is right but it doesn't seem to work and just carrys on regardless. Any help would be appreciated.

    Please Login or Register  to view this content.
    Last edited by aaron.ronnie; 04-29-2009 at 05:37 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Msg box response is ignored

    Welcome to the forum. One of the important forum rules is to wrap
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Re: Msg box response is ignored

    Hi

    Try the following code, which splits up your macro in to two parts one for the button and one for the code you wish to call.

    Please Login or Register  to view this content.
    Regards

    Jeff

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Msg box response is ignored

    aaron.ronnie

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Msg box response is ignored

    I have added Code Tags this time, please be sure to read the Forum rules before posting again.

    This code asks for a response then copies the data. Note it does not use the loop - which would take longer, nor is it necessary to activate or select sheets and ranges

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-26-2009
    Location
    Norfolk
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Msg box response is ignored

    That's fantastic! They all work, there is plenty of learning for me there! Thank you all for your rapid response. Apologies for the mistake with my thread. Still not quite sure how to 'add tags' but I will make sure I learn and do it right next time.

  7. #7
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Msg box response is ignored

    You habe indicated that the replies have resolved your pronlem - Please mark your thread as Solved

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    Re Wrapping VBA code

    The easiest way to use code tags is to click on the # icon in the text formatting window

    This will add
    [ Code] [\ Code]
    to your message window with the cursor between the ][ brackets - this is were your VBA code goes.
    You will not see your code displayed correctly until you preview or post your message

    Note:- there is no space before the word Code like I have shown in the example above

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

+ 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