Hi All,
Attached is a test code example of the problem I am encountering. I have looked at the numerous posts with similar if not the same problem however none that i have tried including CDate has managed to correct the problem.
As with other posts I need to format the date in a dd/mm/yyyy format. When the date is selected it appears correct in the userform however when it is added to the spreadsheet it changes to US format mm/dd/yyyy. My computer's regional settings are set correctly. I am also using Excel 2010.
When the data is returned from the spreadsheet to be edited it is formatted correctly in the userform.
Strange is how the data appears on the spreadsheet. If the day is 13 or more e.g. 17/04/2014 it will be formatted correctly on the spreasheet but be formatted as text. Conversely, if the day is 12 or below e.g. 12/04/2014 (April 12) will appear as 04/12/2014 (December 4) and be formatted as a date.
I have checked the formatting of column B where the dates are contained and if I change the formatting from Date (Short Date) to General. The dates with a day of 12 or below (second example above) will change to a number e.g.4/6/1999 will become 36315 whereas the first examples remain as text.
I need the dates to be "dates" as I am calculating a current DOB.
I have tried to use DatePicker however this has not worked either for different reasons in that i am unable to capture a NULL error when reseting the userform controls and workign with a blank textbox in conjunction with the calculating the age.
In the attached example I am using Monthview. I have tried RoyUK's CalendarForm and this resulted in the same formatting error as described above.
I apologise if there is a solution i have overlooked and appreciate any assistance.
Thanks
Darren
Bookmarks