+ Reply to Thread
Results 1 to 4 of 4

pass control to user while running macro

  1. #1
    Registered User
    Join Date
    06-06-2011
    Location
    Boston MA
    MS-Off Ver
    Excel 2007
    Posts
    1

    pass control to user while running macro

    I need to pass control from a running macro to the user allowing them to edit values in a worksheet and them pass control back to the macro to continue processing.

    Specifically the macro reads content from an external file (Bill of Material) , places select part numbers and quantities into a worksheet that requires the user to correct the quantity associated with those parts. When done reviewing/changing the data I want the macro to continue to run and finish performing subsequent work.

    What I do not know how to do is pass control back to the user to allow him/her to edit the worksheet and then signal the macro that the work is done.

    I would prefer not to go the route of a user form as it limits the user (to use scroll bars etc..).

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: pass control to user while running macro

    Use a modeless userform with a label that prompts the user and a Continue button.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481

    Re: pass control to user while running macro

    How can you get the code to pause while waiting for input from the user?

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

    Re: pass control to user while running macro

    Hi,

    Following up on shg's suggestion with a small example. Attached is a workbook for adding information to a worksheet.

    I have replace the normal UserInfo.show command with:

    Please Login or Register  to view this content.
    Hope this helps.

    abousetta
    Attached Files Attached Files
    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.

+ 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