Thread: Pop-Up Calendar
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
John John is offline
external usenet poster
 
Posts: 2,069
Default Pop-Up Calendar

following will produce popup calendar in all rows col A - change as required.
Paste in code page of required worksheet.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
With Calendar1
If Not Application.Intersect(Range("A:A"), Target) Is Nothing Then
.Left = Target.Left + Target.Width - Calendar1.Width
.Top = Target.Top + Target.Height
.Visible = True
' select Today's date in the Calendar
.Value = Date
ElseIf .Visible Then .Visible = False
End If
End With
End Sub

Private Sub Calendar1_Click()
With ActiveCell
.Value = CDbl(Calendar1.Value)
.NumberFormat = "mm/dd/yyyy"
.Select
End With
If Calendar1.Visible Then Calendar1.Visible = False
End Sub

--
JB


"Gav123" wrote:

Hi Otto,

Maybe Ron de Bruin's site will be what your looking for..

http://www.rondebruin.nl/calendar.htm

Hope this helps,

Gav.

"Otto Moehrbach" wrote:

Excel XP & Win XP
I know there is a calendar capability within Excel but I have never used it.
What I am asking for is a place/site to go to to get the information I need.
What I want to do is this:
The user clicks on a cell, firing a Worksheet_SelectionChange macro.
This will cause a calendar to pop up.
The user clicks on a date and that date is entered into that cell and the
calendar disappears.
Any help would be appreciated. Thanks for your time. Otto