Closed Thread
Results 1 to 9 of 9

msg box question

  1. #1
    Registered User
    Join Date
    09-04-2007
    Posts
    67

    msg box question

    Lost it...had it written down but lost the directions...aghhhh

    Anyone?

    Also, Can I add a way so if I run a macro and the msg box pops up before the pops up when done, is there a way I can select yes to complete the macro or no to shut it down.
    Its important that I write a macro to delete a bunch of cells, but if the user does it by mystake - alot going on in that page - I would like a way to confirm the deletion - like yes to proceed or no to cancel. The macro just deletes some cells (but alot that the user may have already inputted) and the pages are protected but those cells.

    Helping a friend working on a project and these are about the last of things I have left. The file is big now - about 15-20 meg. Is there a place here where I can upload the final project for a viewing or anyone like to look at it. Of course you would be able to use it when all completed.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello jerryjaysr,

    I can answer you about adding the Yes No buttons to a message box. See the Example below...
    Please Login or Register  to view this content.
    "No" is the default button. If you want the "Yes" button use vbDefaultButton1 constant instead of vbDefaultButton2.

    Sincerely.
    Leith Ross

  3. #3
    Registered User
    Join Date
    09-04-2007
    Posts
    67

    Not sure

    NOt sure if I am doing it right. Made a quick object box, created a macro,
    inserted the lines exactly from above and get syntax error when I run it on
    Answer = MsgBox Msb, vbYesNo+vbDefaultButton2

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834
    a typo

    Msb -> Msg

  5. #5
    Registered User
    Join Date
    09-04-2007
    Posts
    67

    Still not working

    now have:
    Answer = MsgBox Msg, vbYesNo+vbDefaultButton1

    and still get compile error: end of statement

    ?????

    Macro has exactly what LR wrote with the switch of msg and still does not work

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    jerryjaysr

    Please read forum rules & wrap your VBA code

    A thread with the rules is available at the top of each forum or see links below

    If you do not understand the VBA code wrap instructions have a look at my last reply in this thread
    http://www.excelforum.com/showthread.php?t=583950
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  8. #8
    Registered User
    Join Date
    09-04-2007
    Posts
    67

    Okay

    will do....

    Thanks for post....works great!

  9. #9
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    VBA code not wrapped as requested

    Closing Thread

Closed 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