+ Reply to Thread
Results 1 to 9 of 9

Need to run macros depending on msgbox button clicked

  1. #1
    Registered User
    Join Date
    01-11-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    91

    Need to run macros depending on msgbox button clicked

    I need to run a macro from a message box. If the user clicks yes it runs a macro to check if all data in the column has been entered. If all cells contain data a macro runs copying the data to another sheet. If an empty cell is found the user gets another message box telling them data is missing. When they click OK the macro should stop, but at the moment the copy macro still runs. Anyone got any ideas?
    Cheers

    Ross

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need to run macros depending on msgbox button clicked

    Hi,

    Immediately after the message box which warns that data is missing enter the instruction:
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-28-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Need to run macros depending on msgbox button clicked

    Hi,

    I wish to know how to make the message Box that able to click whether to enable or able the macro

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need to run macros depending on msgbox button clicked

    Hi your original post implied you already have a message box within a macro. You said:
    but at the moment the copy macro still runs
    and indeed the title says 'need to run macros depending on...'

    You now appear to be implying that you don't have any code at all.

    Is that correct. If so please upload your workbook. There's no point in us guessing what it looks like if you want us to create a specific macro.

    Regards

  5. #5
    Registered User
    Join Date
    01-11-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Need to run macros depending on msgbox button clicked

    Hi Richard

    the reply above wasn't from me, but was from grace14! I would gladly upload the work book but I haven't figured out how to do that yet.

  6. #6
    Registered User
    Join Date
    01-11-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Need to run macros depending on msgbox button clicked

    I have code to check for and empty cell

    Please Login or Register  to view this content.
    and I have a message box to run this

    Please Login or Register  to view this content.
    and another message box to inform the user data is missing

    Please Login or Register  to view this content.
    I need to 'join these up' but also, if there is no data missing I want to run another macro that copies the data somewhere else.

  7. #7
    Registered User
    Join Date
    02-28-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Need to run macros depending on msgbox button clicked

    I'm Grace and sorry about not putting my name in the post.

    Is there any way to make the mgs box?

  8. #8
    Registered User
    Join Date
    01-11-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Need to run macros depending on msgbox button clicked

    Aha. Think that's it

    Dashboard.xlsm

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need to run macros depending on msgbox button clicked

    @grace14


    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

+ 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