Thread: Date Problem
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David McRitchie David McRitchie is offline
external usenet poster
 
Posts: 903
Default Date Problem

Hi aliased "Subs",
Excel will use the short date format from your Regional Settings.
VBA will use the US date format.

You need to use Dateserial in VBA the same way
that you might use the DATE Worksheet Function in Excel
in a date calculation formula to make sure that you enter
a calculated date properly when you might otherwise have
a problem.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Subs" wrote in message ...
Hi All

I have a problem with the dates, I have a userform with two textboxes which
have a date in them by default. i.e. (English Short Date) 23/03/05, I also
have a number of buttons where the user can click and can change (increment)
any part of the date i.e. the Day the month or the year.

However when I use the buttons I get strange results the year changes into
4 digits and the date changes to the American Date Format.

When this happens, I go into regional and language settings and then
regional options, customise and reset the settings. save it and the userform
works fine .
But when I close it and reopen it it reverts back to the American Format.

Can anyone help me with this

Knd Regards

Subs