INSERTING Calender Option into Cells


Posted by Glen Murray on August 02, 2001 9:46 PM

Can you insert a Calender option into a cell somewhat similiar to how Access annotates dates.

Can anyone advise.

Cheers



Posted by Ivan F Moala on August 03, 2001 7:42 AM

One way to to this is via the use of application events and the calander control.
Just as an example, if you wanted dates to be
entered into column1 cells then;
1) Place a calander control on your sheet
should be avail via Toolbox control | more controls
2) Right click sheet tab and select view code.
3) Pates this code in.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then
ActiveSheet.Shapes("Calendar1").Visible = True
With ActiveSheet.Shapes("Calendar1")
.Top = ActiveSheet.Rows(Target.Row).Top
.Left = ActiveSheet.Columns(Target.Offset(0, 1).Column).Left
Calendar1.LinkedCell = Target.Address
End With
Else
ActiveSheet.Shapes("Calendar1").Visible = False
End If
End Sub


Now if you select any cell in column1 the
calander will show, allowing you to select
a date that is place on the active cell.


HTH

Ivan