1、1. Alt+F11 按下显示代码窗口后,再松开 Alt+F11.2. 然后按 F7 ,调出 VBA 窗口。3. 粘贴以下代码.Private Sub Calendar1_Click()Dim MyDay As DateActiveCell = Calendar1.ValueMydate = Calendar1.ValueMsgBox MydateCalendar1.Visible = 0End SubPrivate Sub Worksheet_SelectionChange(ByVal Target As Range)If Target.Column = 1 Or Target.Column
2、 = 1 And Target.Row 0 ThenIf IsDate(Target) ThenCalendar1.Value = TargetElseCalendar1.TodayEnd IfCalendar1.Visible = -1Calendar1.Top = ActiveCell.Top + ActiveCell.HeightCalendar1.Left = ActiveCell.Left + Cells(ActiveCell.Rows.Count, 3).LeftElseCalendar1.Visible = 0End IfEnd Sub4. 打开文件保存 book1(S)5. 打
3、开视图对象窗口6.打开插入对象窗口7.找到日历控件 11.0 或 9.0,按确定退出。8.单击第一列(A 列)中的任一单元格,选择日历中的需要的日期即可。备注:要改变日期输入位置,可按以下方法调整代码,找到下面的代码行(此代码行的意思是在 A 列(第 1 列)中添加日历。If Target.Column = 1 Or Target.Column = 1 And Target.Row 0 Then然后根据以下的方法覆盖粘贴此行代码1.以下这一句就是 B3:C5 区域调用日期控件.If Target.Column = 2 And Target.Row 2 And Target.Row 2 And Target.Row 0 Then3.这句是说在 C2:C50 调用日期控件.If Target.Column = 3 And Target.Row 1 And Target.Row 51 Then