+ Reply to Thread
Results 1 to 3 of 3

Wait for user response

  1. #1
    Forum Contributor
    Join Date
    07-11-2005
    Posts
    110

    Wait for user response

    How do I pause a macro to wait for a user's response (Yes/No type response) before the macro continues?

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good evening Brisbane Rob

    The code below shows how to get a MsgBox to await a yes/no input from a user. Technically, you only need line 2, the lines after that just demonstrate how to capture the user response.

    Sub Test()
    Response = MsgBox("The macro has now stopped. Select Yes or No", vbYesNo)
    If Response = vbYes Then
    MsgBox "Selected : Yes"
    Exit Sub
    End If
    MsgBox "Selected : No"
    End Sub

    HTH

    DominicB

  3. #3
    Forum Contributor
    Join Date
    07-11-2005
    Posts
    110

    Thanks

    Thanks a lot - very much appreciated

+ 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