
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$3" Then
Calendar1.Visible = True
'Cancel = True
Else
Calendar1.Visible = False
End If
End Sub
Private Sub Calendar1_Click()
'TextBox1.Value = Calendar1.Value
ActiveCell = Calendar1.Value
Calendar1.Visible = False
End Sub |
Dim x As Long, Y As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Y = ActiveCell.Column
x = ActiveCell.Row
If Y = 1 Then
Calendar1 = Date
Calendar1.Visible = True
End If
End Sub
Private Sub Calendar1_Click()
Cells(x, Y) = Calendar1.Value
Calendar1.Visible = False
End Sub
|
