MsgBox'es

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 8 of 8

Thread: MsgBox'es

  1. #1
    New Member
    Join Date
    Feb 2004
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default MsgBox'es

     
    Alright, Ive been using message boxes throughout my spreadsheet, such as:

    MsgBox "Please now fill in the details. Only those colored in white are necessary. Press 'Confirm Order' to complete the order", vbOKOnly, "Information"

    However, you know the way there is the proper information boxes, with the question mark etc in it, like you have in data validation. Is there any thing especially for it, maybe an alternative for "vbOKOnly" or something?

    Matt

  2. #2
    MrExcel MVP DRJ's Avatar
    Join Date
    Feb 2002
    Location
    California
    Posts
    3,853
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    do you mean like this?

    MsgBox "Hi", vbQuestion

  3. #3
    Board Regular Cbrine's Avatar
    Join Date
    Dec 2003
    Location
    Brampton
    Posts
    3,196
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: MsgBox'es

    MsgBox "Test", vbInformation

    The second parameter determine's what type of message box to show. You have a ton of different options to choose from. Hope this helps.

  4. #4
    MrExcel MVP Zack Barresse's Avatar
    Join Date
    Dec 2003
    Location
    Oregon, USA
    Posts
    10,693
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: MsgBox'es

    here ya go,

    'these are some
    MsgBox ("asdf"), vbCritical
    MsgBox ("zxcv"), vbOKCancel
    MsgBox ("qwerty"), vbOKOnly
    MsgBox ("poiu"), vbQuestion
    MsgBox ("mnbv"), vbYesNo
    MsgBox ("something here.."), vbYesNoCancel
    'and there are others


    there are others too. check out the help files.

    from microsoft help files...

    The following constants can be used anywhere in your code in place of the actual values:

    MsgBox Arguments
    Constant Value Description
    vbOKOnly 0 OK button only (default)
    vbOKCancel 1 OK and Cancel buttons
    vbAbortRetryIgnore 2 Abort, Retry, and Ignore buttons
    vbYesNoCancel 3 Yes, No, and Cancel buttons
    vbYesNo 4 Yes and No buttons
    vbRetryCancel 5 Retry and Cancel buttons
    vbCritical 16 Critical message
    vbQuestion 32 Warning query
    vbExclamation 48 Warning message
    vbInformation 64 Information message
    vbDefaultButton1 0 First button is default (default)
    vbDefaultButton2 256 Second button is default
    vbDefaultButton3 512 Third button is default
    vbDefaultButton4 768 Fourth button is default
    vbApplicationModal 0 Application modal message box (default)
    vbSystemModal 4096 System modal message box
    vbMsgBoxHelpButton 16384 Adds Help button to the message box
    VbMsgBoxSetForeground 65536 Specifies the message box window as the foreground window
    vbMsgBoxRight 524288 Text is right aligned
    vbMsgBoxRtlReading 1048576 Specifies text should appear as right-to-left reading on Hebrew and Arabic systems



    MsgBox Return Values
    Constant Value Description
    vbOK 1 OK button pressed
    vbCancel 2 Cancel button pressed
    vbAbort 3 Abort button pressed
    vbRetry 4 Retry button pressed
    vbIgnore 5 Ignore button pressed
    vbYes 6 Yes button pressed
    vbNo 7 No button pressed
    Regards,
    Zack Barresse
    My Book on Excel Tables
    My Blog @ ExcelTables.com
    (If you would like comments in any code, please say so.)

  5. #5
    Board Regular
    Join Date
    Aug 2003
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: MsgBox'es

    Is it possible to do custom text on the response buttons of a msgbox?

    HT

  6. #6
    MrExcel MVP DRJ's Avatar
    Join Date
    Feb 2002
    Location
    California
    Posts
    3,853
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    If you want to customize the message box you need to just make your own userform. Then you can customize a lot of things the way you want.

  7. #7
    MrExcel MVP Tom Urtis's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, California USA
    Posts
    11,129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: MsgBox'es

    Quote Originally Posted by headtoadie
    Is it possible to do custom text on the response buttons of a msgbox?
    Yes it is possible but probably not worth the effort and API overhead. See the following link, and links within that link, for ways to do what you are asking about:

    http://216.92.17.166/board2/viewtopi...hlight=caption

  8. #8
    Board Regular
    Join Date
    Aug 2003
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: MsgBox'es

      
    Tom, thanks for the link...Userform it is!

    HT

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com