Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I have a userform with a textbox where a user will input the date. As I am from Australia, the standard format would be dd/mm/yy. This works ok until I click the OK button and the data is transferred to the worksheet as mm/dd/yy. Can someone tell me if I will need to insert a line of coding in the userform to convert the date to dd/mm/yy and then transferred to the worksheet as dd/mm/yy instead of mm/dd/yy. Thanx in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Whilst Excel handles locale quite well, VBA does not so you will have to
coerce it. This worked for me if the cells were pre-formatted as text Private Sub CommandButton1_Click() Range("A1").Value = DateValue(Me.TextBox1.Value) End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England www.nickhodge.co.uk HIS "Maddoktor" wrote in message ... Hi all, I have a userform with a textbox where a user will input the date. As I am from Australia, the standard format would be dd/mm/yy. This works ok until I click the OK button and the data is transferred to the worksheet as mm/dd/yy. Can someone tell me if I will need to insert a line of coding in the userform to convert the date to dd/mm/yy and then transferred to the worksheet as dd/mm/yy instead of mm/dd/yy. Thanx in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula not reading date format | Excel Discussion (Misc queries) | |||
Reading Text | Excel Discussion (Misc queries) | |||
Copnvert dates reading as Text to a date format | Excel Discussion (Misc queries) | |||
Reading File Name in VB Macro that contains today's date | Excel Discussion (Misc queries) | |||
date reading formula question | Excel Worksheet Functions |