Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a form on which a date can be entered in textbox1. After
clicking OK and submitting the form, the data is copied automatically to a sheet. The problem is that if a user wants to enter a date like 1 february 2007, the date in my sheet displays this date as if the user entered 2nd of january. What I would like to have is: 1. Preformat the textbox1 like DD/MM/YYYY. (If the form opens, textbox1 should display DD/MM/YYYY. Upon selecting the cell, the user can overwrite this with in this case: 01/02/2007 2. Display a label on the form displaying the long date of the date the user has entered. 3. Display the correct date on my sheet as an integer (I use this value to sort my list on) PS: Everything independent of the users' local settings !! Thanks, Mark |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Ixtreme" wrote in message oups.com... I have a form on which a date can be entered in textbox1. After clicking OK and submitting the form, the data is copied automatically to a sheet. The problem is that if a user wants to enter a date like 1 february 2007, the date in my sheet displays this date as if the user entered 2nd of january. What I would like to have is: 1. Preformat the textbox1 like DD/MM/YYYY. (If the form opens, textbox1 should display DD/MM/YYYY. Upon selecting the cell, the user can overwrite this with in this case: 01/02/2007 When loading the textbox, use TextBox1.Text = Format(Range("A1").Value, "dd/mm/yyyy") 2. Display a label on the form displaying the long date of the date the user has entered. 3. Display the correct date on my sheet as an integer (I use this value to sort my list on) Range("B2").Value = CLng(TextBox1.Text) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
I receive a type mismatch. Is there something I have overseen here? Private Sub CommandButton1_Click() ....... Range("D" & LastRow).Value = CLng(TextBox1.Text) ' TextBox1.Text = "13-08-2007" as expected end sub and I have: Private Sub UserForm_Activate() ....... TextBox1.Text = Format(Range("J2").Value, "dd/mm/ yyyy") 'In cell J2 I have =Today() ....... End Sub Thanks , Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with date in user form | New Users to Excel | |||
Date format problem from form to sheet | Excel Discussion (Misc queries) | |||
date format in user form | Excel Programming | |||
Date format and Form | Excel Programming | |||
Date Format on Form | Excel Programming |