Archive of Mr Excel Message Board


Back to Controls in Excel archive index
Back to archive home

Calendar Control

Posted by Jack on September 03, 1999 10:59 AM
Chris, I hope you have a great game!!

I have now made a macro that allows the Calendar control to appear. The problem is now, how do I get the date to input into the text box?.

Thanks again for all you help!!!


Jack


Re: Calendar Control

Posted by Chris on September 07, 1999 6:59 AM
I shot a 98, I guess that's why I keep my day job.

It sounds like you are trying to return a value to the active sheet. Is that correct?

This code shows how to return the date to a cell on the active sheet. Add this to the Calendar's click event:

Private Sub Calendar1_Click()
Dim iDate
iDate = Calendar1.Value
Unload UserForm1
Range("A1").Value = iDate
End Sub

If you were trying to update a text box on that form, you could just use this:

TextBox1.Value = Calendar1.Value

Hope that will suffice.

Chris


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.