+ Reply to Thread
Results 1 to 2 of 2

Message Box Issue

  1. #1
    Registered User
    Join Date
    04-02-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    96

    Message Box Issue

    Hey guys,

    I have the following piece of code:

    Please Login or Register  to view this content.
    Now, for some reason, the message box only comes up with a Yes No option for the "ElseIf" statement and for the "If" statement above it, the only option for the user to click is "OK", however I would like this to be the other way round, how can I do this?

    Any ideas will be greatly appreciated.

    Jamer

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,446

    Re: Message Box Issue

    Hi Jamer and welcome to the forum,

    I don't like (worry about) your code in the ElseIf line:
    You have MsgBox("prompt",buttons) = vbYes Then.

    This may be causing the problem. It is better if you set the Response of the MsgBox and then test it in another line of code.

    see http://vbatutor.blogspot.com/2009/02...-function.html
    or many other examples on the web of "Excel VBA MsgBox"
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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