+ Reply to Thread
Results 1 to 2 of 2

MsgBox response

  1. #1
    Registered User
    Join Date
    01-13-2005
    Posts
    1

    MsgBox response

    I am trying to use a message box to get a response as I would in VB6. The options are there for a yes/no msgbox or any other. It doesn't work so I'm just wondering if this is even possible in VBA. (I'm using Excel 2000).

    If I can't do this I need another suggestion. But first things first - Can I use a msgbox to get a response (yes/no)?

    Sunflower Queen

  2. #2
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282
    Sunflower Queen,

    Here's a sample for using the MsgBox:

    Sub showMessage()
    ' Declare program variables...
    Dim Msg, style, Title, Response
    ' Prompt user to determine to do something
    ' Define user dialog parameters
    Msg = "This program updates some data. Do you want to continue?"
    style = vbYesNo + vbExclamation + vbDefaultButton1
    Title = "Data Updating"
    ' Display user dialog
    Response = MsgBox(Msg, style, Title)
    If Response = vbNo Then ' If user chooses no, stop the program
    Exit Sub
    Else
    ' If user chooses yes, insert your code here...
    End If
    End Sub

    Hope this helps,
    theDude

+ 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