+ Reply to Thread
Results 1 to 14 of 14

Can't Execute Message Box

  1. #1
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Can't Execute Message Box

    Hi,

    Having a dabble with Message Boxes. Basically, I would like to call an error if a certain combination is wrong with an additional OK button to close the message box.
    Does the code go into a module??? Help




    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Can't Execute Message Box?????????????

    MsgBox is a statement, not an object so it has no properties like "Value". The statement does, however, accept parameters

    Please Login or Register  to view this content.
    1st parameter is the message to display
    2nd parameter defines the buttons & icon to display
    3rd parameter is the window title

    All are fully explained in Help
    Last edited by cytop; 02-10-2017 at 05:49 AM.

  3. #3
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can't Execute Message Box?????????????

    So, how can I use the contents of a ComboBox to execute the message?

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Can't Execute Message Box?????????????

    Use the Value of the ComboBox as the literal text to display.

    Also you need to re-read your previous thread ("Is there an 'or' command") and correct the IF statement as posted.

  5. #5
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can't Execute Message Box?????????????

    Like this:


    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can't Execute Message Box?????????????

    Or this???:


    Please Login or Register  to view this content.

  7. #7
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Can't Execute Message Box?????????????

    No- like post 2
    Please Login or Register  to view this content.
    and this needs changing as mentioned
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  8. #8
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can't Execute Message Box?????????????

    So the comment "Use the Value of the ComboBox as the literal text to display" - does this mean that I remove the "" marks like:



    Please Login or Register  to view this content.

  9. #9
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Can't Execute Message Box?????????????

    No, I think cytop assumed you wanted to use the value of the combobox in the message box. Is that the case?

    As discussed in your other thread, you need to use something like
    Please Login or Register  to view this content.
    or a variable
    Please Login or Register  to view this content.
    You can only use the comma separated values syntax with a Select Case statement thus
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can't Execute Message Box?????????????

    ahh right, I'm still thinking ilke its a case,Ill try these and get back to you. Cheers

  11. #11
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can't Execute Message Box?????????????

    Works fine , thanks. Gonna try and develop, Cheers !!!

  12. #12
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can't Execute Message Box?????????????

    Another question, how can I Put the word error in the Caption Frame above dialogue box?



    Please Login or Register  to view this content.

  13. #13
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Can't Execute Message Box

    If you read the help on Msgbox you'll see that the third argument is the title of the message box.

  14. #14
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can't Execute Message Box

    Ah yes got it, Cheers :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Yes/No message box - If no execute code
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2016, 09:33 AM
  2. Execute a macro in a closed workbook, or open and execute without the user noticing
    By cearaujo123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-09-2015, 06:44 PM
  3. code to execute a keyboard shortcut or to execute a toolbar button
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2015, 12:16 PM
  4. [SOLVED] Execute Macro on no response from message box
    By VillaLion in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-21-2014, 12:10 PM
  5. IF cell=error execute sub 1 if value execute sub 2... possible?
    By CDNcameron in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2013, 05:28 PM
  6. Sending a message to the user while continuing to execute
    By SgtSunshine in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-02-2010, 10:28 AM
  7. Execute warning message
    By Pat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2006, 07:15 PM

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