+ Reply to Thread
Results 1 to 4 of 4

Stop Macro, Check Cells & Modify if Necessary, Resume Macro

  1. #1
    Registered User
    Join Date
    05-28-2008
    Posts
    49

    Stop Macro, Check Cells & Modify if Necessary, Resume Macro

    I have attempted to write two custom dialogue boxes. The dialogue box asks the user if he/she wants to check the data input captured by an InputMacro. The InputMacro places the data in specified cells. Thus, the dialogue box is a two button selection - either Yes or No. If No is selected, the InputMacro would resume.

    If yes, the code should transfer you to another dialogue box. This dialogue box asks if you want to stop the macro and make changes to the cells containing the data input. Thus, the dialogue box is a two button selection - either Modify Data or Continue. If Modify Data is selected, I turn Application.EnableEvents to False to allow user corrections to the cells. Once the corrections have been made, the user should be able to select Continue from the second dialogue box (which would still be appearing on the screen). Once Continue is selected, the macro would resume.

    Please Login or Register  to view this content.
    The above code has been set up on module 2. The original "InputMacro" that should resume after the user provides feedback to the above code, is contained in module 1. I don't know if this is the correct way to handle? Should everything be in module 1?

    Additionally, the above code is not working for me.

    My experience with Excel programming is limited and I am trying to learn as I tackle this project.

    Thanks.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Stop Macro, Check Cells & Modify if Necessary, Resume Macro

    Looks like you are using resume in an incorrect context.

    The help says this.
    Remarks

    If you use a Resume statement anywhere except in an error-handling routine, an error occurs.
    Remove the Resume keyword and try your code.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    05-28-2008
    Posts
    49

    Re: Stop Macro, Check Cells & Modify if Necessary, Resume Macro

    I tried taking out the "Resume InputMacro" syntax from both CheckInput1() and CheckInput2().

    When I run CheckInput1(), the dialogue box pops up, but when I press either the "Yes" or "No" buttons, the macro does nothing (i.e. if "Yes" button is pressed, the macro does not call CheckInput2().

    What am I doing wrong?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Stop Macro, Check Cells & Modify if Necessary, Resume Macro

    You removed the resume AND the call to the macro, which is why the macro is not called.

    more like this
    Please Login or Register  to view this content.

+ 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