You must use Code tags whewn posting code in your question.
You don't say how you are triggering the macro, which event you are using. below is some code that will display a Calendar inserted into the worksheet, Visible property manually set to False.
Private Sub Calendar1_Click()
With Range("Paydate")
.Value = CDbl(Calendar1.Value)
.NumberFormat = "dd/mm/yyyy"
.Select
End With
Calendar1.Visible = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Address <> "$D$3" Then 'where to display calendar
Calendar1.Visible = False
Exit Sub
End If
Calendar1.Visible = Not Calendar1.Visible
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
' select Today's date in the Calendar
Calendar1.Value = Date
End Sub
Bookmarks