+ Reply to Thread
Results 1 to 4 of 4

Use of vbCancel in msgbox

  1. #1
    Registered User
    Join Date
    11-29-2013
    Location
    Townsville, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Use of vbCancel in msgbox

    I have the following code on a userform, that checks if a valid date has been entered, and either allows the user to enter the correct date (vbOK), or close the form completely (vbCancel).
    I'm not sure what I'm doing wrong, but the vbCancel doesn't work properly - the form still pops up the message box, even when "Cancel" is clicked.

    I'm sure it's some simple error in my logic here, but go easy on me - I am very old

    Please Login or Register  to view this content.
    Thanks for any help people.

    OM1950

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,258

    Re: Use of vbCancel in msgbox

    Try this:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Use of vbCancel in msgbox

    Try this...

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    11-29-2013
    Location
    Townsville, Australia
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Use of vbCancel in msgbox

    Thanks guys - I really appreciate your help. Now I've got to analyse why your code works, and mine doesn't.

    Thanks again,

    OM1950

+ 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. Exit Sub on vbCancel
    By Ada01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2013, 12:59 AM
  2. [SOLVED] Activate vbCancel in message box
    By datafiend in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2012, 04:41 AM
  3. msgbox vbcancel
    By mqdias in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-24-2007, 11:44 AM
  4. [SOLVED] vbCancel
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-27-2006, 09:10 AM
  5. VBA code for InputBox vbCancel to run the routine
    By Glenn P in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-21-2005, 06:24 PM

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