Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 363
Default I still have trouble with Date Formats. Why is it so ?

An earlier post of mine i received some advice about changing the format of my PC(control
panel-Language-AUSTRALIA dddd dd mmmm yyyy = date long),
But now when i ma trying to use a Calendar popup(userform) to enter a date into a textbox, i keep
getting the date in ODD manners.

If the DAY selected is 12(only 12 months per year) i get the Correct date Format (eg. Thursday 22
February 2007),
yet if i select a DAY <=12, then i get (eg. for 1 Feb 2007 Friday INSTEAD i get[ Tuesday 2 January
2007]).
Which means the DAY and MONTH are being switched around.

How can i prevent this?


'This is the code to show the calendar
Private Sub TextBox25_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single,
ByVal Y As Single)
If UserForm3.TextBox25.Value = "" Then
Call OpenCalendar
UserForm3.TextBox25.Value = Format(TextBox25.Value, "dddd dd mmmm yyyy")
End If
End Sub

'This is the code to input the date into the textbox
Option Explicit
' ================================================== =
' Code by Martin Green eMail
' Visit my Office Tips web site at
www.fontstuff.com
' ================================================== =

Private Sub cmdClose_Click()
' Close the UserForm
Unload Me
End Sub

Private Sub UserForm_Initialize()
' Check if active cell contains a date. If 'yes' show
' same date on calendar. If 'no' show today's date.
Calendar1.Value = DateValue(Now())
Calendar1.Value = Date
End Sub

Private Sub Calendar1_Click()
' Transfer date selected on calendar to active cell
' and close UserForm.
UserForm3.TextBox25.Value = Calendar1.Value
Unload Me
End Sub


Am i doing somehting wrong ?

Corey....


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 / month trouble N Walton Excel Discussion (Misc queries) 3 July 16th 09 05:33 PM
Trouble Entering Old Date Formats JRTB New Users to Excel 2 July 24th 07 04:09 PM
Date trouble Carl Gross Excel Worksheet Functions 4 March 9th 07 12:00 PM
Date trouble BoniM Excel Worksheet Functions 0 January 10th 07 12:53 AM
trouble with date dada Excel Worksheet Functions 1 July 3rd 05 06:07 AM


All times are GMT +1. The time now is 06:29 AM.

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

About Us

"It's about Microsoft Excel"