Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Calendar to insert dates in a form

Hi

Im pretty new in VBA but have managed to create the Calender following the
information given in http://www.fontstuff.com/vba/vbatut07.htm. Now i wood
like to use this for inserting dates in a form (Start Date and EndDate). I
have created the form and made all the code and is seems to work. I am using
to txt fields for entering the start og end dates. I woold like the Calendar
to be the only tool used for entrering dates (no manual date written) - how
can I do this task?

/Stony
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Calendar to insert dates in a form

Hi Steen

Userform or Sheet ?

See this page
http://www.rondebruin.nl/calendar.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steen" wrote in message ...
Hi

Im pretty new in VBA but have managed to create the Calender following the
information given in http://www.fontstuff.com/vba/vbatut07.htm. Now i wood
like to use this for inserting dates in a form (Start Date and EndDate). I
have created the form and made all the code and is seems to work. I am using
to txt fields for entering the start og end dates. I woold like the Calendar
to be the only tool used for entrering dates (no manual date written) - how
can I do this task?

/Stony

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Calendar to insert dates in a form

Useform

"Ron de Bruin" wrote:

Hi Steen

Userform or Sheet ?

See this page
http://www.rondebruin.nl/calendar.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steen" wrote in message ...
Hi

Im pretty new in VBA but have managed to create the Calender following the
information given in http://www.fontstuff.com/vba/vbatut07.htm. Now i wood
like to use this for inserting dates in a form (Start Date and EndDate). I
have created the form and made all the code and is seems to work. I am using
to txt fields for entering the start og end dates. I woold like the Calendar
to be the only tool used for entrering dates (no manual date written) - how
can I do this task?

/Stony


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Calendar to insert dates in a form

Hi Steen

Try this basic example

Add two userforms to the workbook
One with only the calendar named Userform1

Add this code event

Private Sub Calendar1_Click()
UserForm2.ActiveControl.Value = Me.Calendar1.Value
Unload Me
End Sub

And one with the name Userform2 with this code

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

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


Run the userform named Userform2 to test



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steen" wrote in message ...
Useform

"Ron de Bruin" wrote:

Hi Steen

Userform or Sheet ?

See this page
http://www.rondebruin.nl/calendar.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steen" wrote in message ...
Hi

Im pretty new in VBA but have managed to create the Calender following the
information given in http://www.fontstuff.com/vba/vbatut07.htm. Now i wood
like to use this for inserting dates in a form (Start Date and EndDate). I
have created the form and made all the code and is seems to work. I am using
to txt fields for entering the start og end dates. I woold like the Calendar
to be the only tool used for entrering dates (no manual date written) - how
can I do this task?

/Stony


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Calendar to insert dates in a form

Add one line in the click event

Private Sub Calendar1_Click()
UserForm2.ActiveControl.Value = Me.Calendar1.Value
UserForm2.ActiveControl.SetFocus
Unload Me
End Sub


Good night



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
Hi Steen

Try this basic example

Add two userforms to the workbook
One with only the calendar named Userform1

Add this code event

Private Sub Calendar1_Click()
UserForm2.ActiveControl.Value = Me.Calendar1.Value
Unload Me
End Sub

And one with the name Userform2 with this code

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

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


Run the userform named Userform2 to test



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steen" wrote in message ...
Useform

"Ron de Bruin" wrote:

Hi Steen

Userform or Sheet ?

See this page
http://www.rondebruin.nl/calendar.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steen" wrote in message ...
Hi

Im pretty new in VBA but have managed to create the Calender following the
information given in http://www.fontstuff.com/vba/vbatut07.htm. Now i wood
like to use this for inserting dates in a form (Start Date and EndDate). I
have created the form and made all the code and is seems to work. I am using
to txt fields for entering the start og end dates. I woold like the Calendar
to be the only tool used for entrering dates (no manual date written) - how
can I do this task?

/Stony



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Calendar to insert dates in a form

Hi Ron

Hope you had a good sleep you deserve it :-)

You are the best - works great.

Two questions:
1. Can the format be changed - it displays dates in the format "mm/dd/yyyy"
and I would like it to be "yyyy.mm.dd"
2. I am using the dates to filter a list of dates and with the format used
by the Calendar (mm/dd/yyyy) everything works :-), but with the other date
format there seems to be a problem (yyyy.mm.dd). The filter (custom) is setup
right but the filter dosn't work right before I activate i manualy once more
- can you help on that?

-------------------------------------------
If ErrorHandling Then
...
Else
Dim sStart, sEnd As String
sStart = txtStartDate.Value
sEnd = txtEndDate.Value
Selection.AutoFilter Field:=3, Criteria1:="=" & sStart,
Operator:=xlAnd, Criteria2:="<=" & sEnd
End If
--------------------

"Ron de Bruin" wrote:

Add one line in the click event

Private Sub Calendar1_Click()
UserForm2.ActiveControl.Value = Me.Calendar1.Value
UserForm2.ActiveControl.SetFocus
Unload Me
End Sub


Good night



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
Hi Steen

Try this basic example

Add two userforms to the workbook
One with only the calendar named Userform1

Add this code event

Private Sub Calendar1_Click()
UserForm2.ActiveControl.Value = Me.Calendar1.Value
Unload Me
End Sub

And one with the name Userform2 with this code

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

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


Run the userform named Userform2 to test



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steen" wrote in message ...
Useform

"Ron de Bruin" wrote:

Hi Steen

Userform or Sheet ?

See this page
http://www.rondebruin.nl/calendar.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steen" wrote in message ...
Hi

Im pretty new in VBA but have managed to create the Calender following the
information given in http://www.fontstuff.com/vba/vbatut07.htm. Now i wood
like to use this for inserting dates in a form (Start Date and EndDate). I
have created the form and made all the code and is seems to work. I am using
to txt fields for entering the start og end dates. I woold like the Calendar
to be the only tool used for entrering dates (no manual date written) - how
can I do this task?

/Stony


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
How do i insert an interactive calendar in an excel form Maria[_3_] Setting up and Configuration of Excel 2 April 26th 09 01:54 PM
How can I insert a date with an icon (calendar) insert Alfredo Mederico[_2_] Excel Discussion (Misc queries) 4 September 21st 07 01:20 AM
pull down calendar to insert dates & times R Dunn Excel Discussion (Misc queries) 2 January 10th 07 01:32 AM
How to insert a calendar to choose dates- JoeMa Excel Discussion (Misc queries) 2 April 7th 06 04:55 PM
Copy form field value to another form (calendar) [email protected] Excel Programming 1 December 1st 05 09:58 PM


All times are GMT +1. The time now is 11:17 AM.

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"