+ Reply to Thread
Results 1 to 3 of 3

VBA Calender Formatting Date Problems

  1. #1
    Registered User
    Join Date
    01-09-2006
    Posts
    22

    VBA Calender Formatting Date Problems

    Hi,

    I've had a good search around about this but I don't seem to be able to find the anwser so I aplogise if this is a duplicate post!

    The problem I've got is, I call up a user form then the user can either type in the date manually into a text box or choose to call up the vba calender. When they call up the calender they can click on the date, the calender closes and the date is entered into the text box. The date format which is entered is mm-dd-yy, but when the user presses ok the date is formatted to dd-mm-yy (English boy you see!). That works fine until it's the start of the month, because for example todays date is 01-04-06, it enters it into the text box as 04-01-06 and see's it being 4th Jan 06 rather than 01st Apr 06.

    Is there any way of formatting the date so that when you click the calender the date is automatically formated to dd-mm-yy?

    Any help would be great

    Thanks,

    Dave

  2. #2
    Carim
    Guest

    Re: VBA Calender Formatting Date Problems

    Hi,

    Instead of using
    Calendar1.Value
    use following :
    Format(Calendar1.Value, "Short Date")

    HTH
    Carim


  3. #3
    Registered User
    Join Date
    01-09-2006
    Posts
    22
    Your ace!! Works fine now! Thank you so much!!

    Dave

+ Reply to 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