HI Everyone
i am trying to setup an Excel 2010 userform that takes a date in TextBox and uses it as delivery date, the wierd thing is that sometimes it converts the date from Australian format DD/MM/YYY to american date format MM/DD/YYY.
i have read a couple of people talking about how excel is american centric hence why it converts the date and i have been trying to setup a format script on the code to force the Australian date formatting as below.
' trying to format date DD/MM/YYYY not MM/DD/YYYY
If Not IsDate(Me.DeliveryDateField.Value) Then
MsgBox "Input must be a date in the format: 'dd/mm/yyyy'", vbExclamation, "Essential Items"
Me.DeliveryDateField.SetFocus
DeliveryDateField = Format(DeliveryDateField, "dd/mm/yyyy")
Exit Sub
the debug doesnt pickup any errors so im not sure if something is overriding the date after this or if i am simply putting the date formatting command in the wrong place.
i REALLY hope someone can help me with this as its very tedious for me to have to get the data from the spreadsheet and then go into every invoice and check the date is in the correct format..
i am trying to setup an Excel 2010 userform that takes a date in TextBox and uses it as delivery date, the wierd thing is that sometimes it converts the date from Australian format DD/MM/YYY to american date format MM/DD/YYY.
i have read a couple of people talking about how excel is american centric hence why it converts the date and i have been trying to setup a format script on the code to force the Australian date formatting as below.
' trying to format date DD/MM/YYYY not MM/DD/YYYY
If Not IsDate(Me.DeliveryDateField.Value) Then
MsgBox "Input must be a date in the format: 'dd/mm/yyyy'", vbExclamation, "Essential Items"
Me.DeliveryDateField.SetFocus
DeliveryDateField = Format(DeliveryDateField, "dd/mm/yyyy")
Exit Sub
the debug doesnt pickup any errors so im not sure if something is overriding the date after this or if i am simply putting the date formatting command in the wrong place.
i REALLY hope someone can help me with this as its very tedious for me to have to get the data from the spreadsheet and then go into every invoice and check the date is in the correct format..