![]() |
Date in text box reading mm/dd/yy instead of dd/mm/yy
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. |
Date in text box reading mm/dd/yy instead of dd/mm/yy
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. |
All times are GMT +1. The time now is 03:46 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com