Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar Control in EXCEL 3

Status
Not open for further replies.

bluebilly

Technical User
Nov 11, 2002
48
AU
I want to add a calendar to an Excel spreadsheet and have successfully 'drawn' one having selected Calendar Control via the More Controls option from the Control Toolbox.
Basically, how do I now make the calendar clickable so that it stores a selected date in a cell ?
I have no VB knowledge to speak of so would appreciate an idiot's guide if possible !

Many Thanks

 
bluebilly,

I have an example file I've created. I can email you this if you like. Email me and I'll send the file via return email.

Basically, it's a matter of setting up a VBA routine such as the following...

Private Sub Calendar1_Click()
If ActiveCell.Column <> 2 Then Exit Sub
ActiveCell.Value = Calendar1.Value
End Sub


Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
In design mode, with the calendar selected, click the properties button, which will show the properties window, and for the property called LinkCell, type in a value of A1 or C4 or whatever cell reference you want the date stored in.

That's it.

Cheers, Glenn.
 
Re GlennUK's response - this appears to be the simplest solution which even I understand - however when I 'draw' the calendar having selected it from the Control box - it is still not clickable even after I have completed the CellLink property.

Thanks for your time
 
Bluebilly,

after you've finished setting up the calendar ( and after setting the LinkedCell property), you need to simply end Design Mode. Click the first symbol of the Control Toolbar, and the calendar should start working.

Cheers, Glenn.
 
I've linked the calendar control to a cell in my worksheet (k25), but how do I permanently set k25 to a number format as opposed to a date format ?
Despite formatting k25 to Number format, everytime I select a new date using the calendar control, it returns say, 20/02/2003 instead of 3762 in cell k25, the latter format I require for sorting.

Any ideas ?

Thanks
Bill
 
Are you going to be sorting by date? If the cells you are going to be sorting on are true Excel dates then the sorting will work fine if the dates are formatted anyway.

Glenn.
 
Thanks Glenn, I've solve it by making an adjoining cell to k25 as =value(k25) and then using this adjoining cell to sort.
Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top