LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Userform, Calender, Problems with Todays Date

Hi,

I have a userform that contains a textbox where a user would enter a date.
To get around the many problems of people using / or : or ; as date
seperators, when the user selects the TextBox a second userform appears using
the Calender tool, the user then clicks on the correct date and the second
userform disappears and the date is now showing in the textbox.

This all works fine apart from one small problem, I cannot get the calender
to default to todays date.

The code I am using is as follows:

When the user selects the TextBox In UserForm2.

Private Sub StartDate_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
UserForm1.Show
End Sub

The code behind the Calender in UserForm1.

Private Sub Calendar1_Click()
UserForm2.ActiveControl.Value = Me.Calendar1.Value
UserForm2.ActiveControl.Value = Format(Me.Calendar1.Value, "dd/mm/yyyy")
UserForm2.ActiveControl.SetFocus
Unload Me
End Sub

I can't remember who I have to thank for the above code, so if you recognise
it - Thanks!!

Any help in getting the UserForm1 calender to default to todays date would
be greatly appreciated.
 
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
Having problems with a calender Tim Hill[_2_] Excel Discussion (Misc queries) 2 November 20th 08 04:44 PM
pop up calender in a userform Albert Excel Programming 4 December 21st 07 05:55 PM
VBA Calender Formatting Date Problems beans_21[_10_] Excel Programming 2 April 3rd 06 02:35 PM
Create a button that will date stamp todays date in a cell Tom Meacham Excel Discussion (Misc queries) 3 January 11th 06 01:08 AM
When I open my past invoice it keeps changing date to todays date Stop date changing to todays in Excel Excel Worksheet Functions 2 October 7th 05 04:54 PM


All times are GMT +1. The time now is 09:18 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"