+ Reply to Thread
Results 1 to 9 of 9

Add Cancel in the message box

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Add Cancel in the message box

    Hello all,
    Is there anyway to add a "cancel" in this code?

    I only see "OK" when a button is clicked.

    Thanks.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Add Cancel in the message box

    here you can find everything
    https://docs.microsoft.com/en-us/off...sgbox-function

  3. #3
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Add Cancel in the message box

    Sorry Gue,
    I am not really familiar with the VBA if you can please tell me how to add this then.

    vbOKCancel

    Thanks.

  4. #4
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Add Cancel in the message box

    I need to edit this code to add this : vbOKCancel

  5. #5
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Add Cancel in the message box

    Hi
    Ok, I was able to add it but when I click the button and I click the "cancel", the worksheet still save. Please edit the code. Thank you.

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Add Cancel in the message box

    Please Login or Register  to view this content.
    your code:
    if you first save your workbook with
    Please Login or Register  to view this content.
    then the next line
    Please Login or Register  to view this content.
    makes no sense.
    Setting saved to True means that a modified workbook will be closed without either saving it or being prompted to save it. You can skip this line.

  7. #7
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Add Cancel in the message box

    Please Login or Register  to view this content.

    This is what I have so far, but after some of my entry and I click the button and I cancel. It still saved it

  8. #8
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Add Cancel in the message box

    yes because your first statement says "save the workbook"

    change it to
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Add Cancel in the message box

    Yay! Thank you Gue.

+ 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] Keep checkbox checked when cancel on pop up message
    By Blokeman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2015, 01:30 AM
  2. Message Box Prompt. Continue Or Cancel
    By ashleys.nl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-12-2011, 02:30 PM
  3. Message Box Popup with OK or Cancel
    By SHA_doms in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-11-2010, 01:34 PM
  4. Cancel a message box pop up action
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-14-2009, 06:46 PM
  5. Cancel Button of Message Box
    By leelee23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2007, 05:30 AM
  6. [SOLVED] Can't get Cancel to work in message box
    By * Kenneth * in forum Excel General
    Replies: 1
    Last Post: 03-30-2006, 03:15 PM
  7. [SOLVED] message box without ok or cancel button
    By Subash in forum Excel General
    Replies: 1
    Last Post: 10-18-2005, 06:05 AM

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