Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Date Problem

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
date problem or is it me? zekni Excel Worksheet Functions 3 July 13th 08 11:16 AM
Exel increment date problem wrt todays date. [email protected] Excel Worksheet Functions 1 November 11th 07 06:58 PM
Date Formula Problem - Leave date blank if Null Gayla Excel Worksheet Functions 5 April 24th 07 09:42 PM
Another Date Problem dnsnider Excel Worksheet Functions 2 December 25th 04 03:23 AM
Date problem M. lane Excel Programming 6 September 28th 03 09:41 PM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"