+ Reply to Thread
Results 1 to 2 of 2

Excel VBA - Closing calendar in userform incorrectly inserts date in the textbox

  1. #1
    Registered User
    Join Date
    08-10-2015
    Location
    London
    MS-Off Ver
    XP
    Posts
    2

    Excel VBA - Closing calendar in userform incorrectly inserts date in the textbox

    Hello,

    I have a user form built in VBA Excel that uses a few textboxes with date values.
    For these date values I am using a datepicker.

    When the user clicks on the date textbox this brings up the calendar form to the screen so that the user can select the date value.

    However, when the user does not want to choose the date and just clicks on X at the right top corner of the calendar form this closes the form, as expected, but also still inputs the value in the textbox.

    What I am trying to achieve is that when the user clicks on X, this just closes the calendar form and DOES NOT INPUT the date value in the textbox.

    Does anybody have any idea how this can be achieved?

    Thank you!


    If that's of any help here, this is the code behind the calendar form:

    Please Login or Register  to view this content.

    There is also some code behind each of the date textboxes mainly to ensure the logical checks are in place (for example, not dates in the future are allowed etc).


    Thank you again!
    Last edited by pi_tiger; 12-01-2015 at 06:39 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Excel VBA - Closing calendar in userform incorrectly inserts date in the textbox

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.
    If posting code please use code tags, see here.

+ 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. Replies: 1
    Last Post: 07-23-2015, 11:18 PM
  2. [SOLVED] How can I add Hyperlink for Thisworkbook.Worksheet with userform textbook
    By sanjaypalsjp in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-06-2015, 09:38 AM
  3. [SOLVED] Excel 2007, Userform Textbox Date Format and Calendar Control Userform
    By riffology in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2014, 06:18 PM
  4. [SOLVED] Problem closing calendar with userform
    By pezalmendra in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2012, 12:04 PM
  5. Using a userform Calendar to fill in an excel calendar, and also a log
    By 00Able in forum Excel Programming / VBA / Macros
    Replies: 64
    Last Post: 09-08-2011, 08:50 PM
  6. Default date in Userform Calendar
    By AndyE in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-05-2010, 01:15 PM
  7. [SOLVED] date in Excel displays incorrectly when merged in letter
    By Feather 52 in forum Excel General
    Replies: 1
    Last Post: 03-13-2006, 06:40 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