http://www.excelpx.com/thread-255298-1-1.html
Private Sub Calendar1_Click()
With Calendar1
ActiveCell = .Value ‘赋值给激活单元格
.Visible = False ‘隐藏日历控件
End With
End Sub
‘
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Calendar1
If Target.Column = 3 Then ‘如果选择C列
.Top = Target.Offset(0, 1).Top ‘设置位置
.Left = Target.Offset(0, 1).Left
.Visible = True ‘显示日历控件
Else
.Visible = False ‘隐藏日历控件
End If
End With
End Sub
时间: 2024-10-18 05:50:18