View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Create a drop down calendar in a cell?

If you only want to use it in C3 then use this

Private Sub Calendar1_DblClick()
ActiveCell.NumberFormat = "m/d/yyyy"
ActiveCell = Calendar1.Value

' This will hide it after you DblClick on a date
Calendar1.Visible = False
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' this is the range where the SelectionChange is working
' I change it to c3 only
If Not Application.Intersect(Range("c3"), Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Else: Calendar1.Visible = False
End If
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"ali " wrote in message ...
Many thanks for your help, however it is not quite working as i
hoped...

I have followed the steps you gave me and now have a calendar on screen
permanently.

Ideally i want the calendar to be hidden until the user clicks on cell
"c3" and to then disappear once the user has selected the desired date.
The desired date will of course be left behind in cell c3.

Any idea what i'm doing wrong? Many thanks


---
Message posted from http://www.ExcelForum.com/