+ Reply to Thread
Results 1 to 13 of 13

Getting yes & no buttons to work in MsgBox

  1. #1
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Getting yes & no buttons to work in MsgBox

    I think im missing an "IF" or "=" but spent hours now trying to figure this out but cant




    Please Login or Register  to view this content.
    Basically i want to display the box "help? continue to common issues, email to email, cancel to return

    If they then go common issues and decide to email i want the user to email, if they think "yes the common issues help i want to go back to the sheet, then go back to the sheet?????
    Last edited by shiftyspina; 05-02-2013 at 11:57 AM. Reason: confidentiality

  2. #2
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: Getting yes & no buttons to work in MsgBox

    are you getting an error in this line?

    Please Login or Register  to view this content.
    Thanks!
    Raga.

    Please,mark your thread [SOLVED] if you received your answer.

    Click the little star * below, to give some Rep if you think an answer deserves it.

    I learnt so many things from these links.

  3. #3
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Getting yes & no buttons to work in MsgBox

    Yes, but it is not higlighting that part, it is highlighting the Private Sub line, although before i put in the If MsgBox line it worked fine.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Getting yes & no buttons to work in MsgBox

    You have provided an email id and contact no in the code in post 1. Is that real and supposed to be confidential info? If yes, please edit the code and put dummy info in.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  5. #5
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Getting yes & no buttons to work in MsgBox

    Ooops sorry, i have ammended the code now

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Getting yes & no buttons to work in MsgBox

    Hi, shiftyspina,

    maybe like this:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  7. #7
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Getting yes & no buttons to work in MsgBox

    Holger that is fantastic except, cancel means basically return to spreadsheet, i added in userform.show to get it to do something, but when clicking cancel or close it still wants to send an email? i really just want it to return to the worksheet, yet whatever i put in it wants to send an email?

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Getting yes & no buttons to work in MsgBox

    Hi, shiftyspina,

    you could use either Exit Sub as command (leaving the sub just running) or End (which would stop all macros even those which called this one).

    And with the code published if you choose yes and press Ok the mail will be sent (thatīs how I understood the code you supplied). If thatīs where you have the problem please comment the lines for email macro out.

    Ciao,
    Holger
    Last edited by HaHoBe; 05-02-2013 at 12:13 PM. Reason: further explanation (italic)

  9. #9
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Getting yes & no buttons to work in MsgBox

    Hi

    What i need is if you click no in the first msgbox it sends an email, then if you click yes it shows some common issues, from that common issue msgbox it will say ok or cancel if you click ok it will send an email if you click cancel it will return to the spread sheet

    At the moment if i click cancel or close it still wants to send the email

    Please Login or Register  to view this content.

  10. #10
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Getting yes & no buttons to work in MsgBox

    Hi, shiftyspina,

    sorry, donīt really understand what you are after, maybe like this:
    Please Login or Register  to view this content.
    Ciao,
    Holger

  11. #11
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Getting yes & no buttons to work in MsgBox

    Hi Holger

    Thank you, i do appreciate your help but now with the loop on it just keeps restarting the first msgbox which the vbyesnocancel. When any cancel or closed is pushed i need it to completely exit the msgboxs and return to the excel sheet?

    I only want an email sent if "NO" is pushed in the first msgbox, and "OK" is pushed in the seconf msgbox
    Im sorry if im not explaining very well, and the fact i cant do it

  12. #12
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Getting yes & no buttons to work in MsgBox

    Hi, shiftyspina,

    it takes at least two persons to not understand a problem.

    Please Login or Register  to view this content.
    Ciao,
    Holger

  13. #13
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Getting yes & no buttons to work in MsgBox

    WooHoo!!! thanks Holger works like a dream now thank you very very much

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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