+ Reply to Thread
Results 1 to 4 of 4

Date Format problem in User Form

  1. #1
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256

    Date Format problem in User Form

    Hi

    I have User Form with one textBox which is used for entering date. Here in India standard date format is DD/MM/YYYY. After data entry is completed through this User FOrm I have to pick up some entries based on date filed. However it seems that date format in User Form is MM/DD/YYYY by default. Thus when user enters 31/3/2006 ( user intend to enter date 31st March, 2006) the same is not recognised as date field in Excel WorkSheet. Similarly when user enters 1/4/2006 (user intend to enter date 1st April, 2006), the same is considered as 4th January, 2006.

    Any solution to this problem?

    Please help

  2. #2
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    I use a calendar control (click Tools, additional controls, Calendar Control 9.0) that the user clicks and that gives me consistently correct data for my textbox!
    Best regards,

    Ray

  3. #3
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256
    Thanks Ray.
    Can you tell me now what should be cell format in worksheet where this textbox is trasferred through User Form?

  4. #4
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    TextBox1.Text = Calendar1.Month & "/" & Calendar1.Day & "/" & Calendar1.Year
    If Date < TextBox1.Text Then
    MsgBox "Date expired"
    Else
    MsgBox "Date NOT expired"
    End If

+ 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