终于找到一位好老师了。请教如下代码的注释: Private Sub Worksheet_Change(ByVal Target As Range) Call ZDY_H(Target) End Sub Private Sub Worksheet_Deactivate() Calendar1.Visible = False End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Call RLSR(Target) End Sub Private Sub Calendar1_DblClick() Calendar1.Visible = False ActiveCell = Calendar1.Value End Sub Sub RLSR(DY As Range) Dim LH As Long HH = DY.Row LH = DY.Column If HH < 12 Then Exit Sub With ActiveSheet If (LH = 5 Or LH = 9) And .Cells(HH, 15).MergeCells Then .Calendar1.Visible = True .Calendar1.Top = DY.Offset(1, 0).Top .Calendar1.Left = Cells(ActiveCell.Row, ActiveCell.Column + 1).Left If Len(ActiveCell) = 0 Then .Calendar1 = Now() Else .Calendar1 = ActiveCell End If Else .Calendar1.Visible = False End If End With End Sub Sub RLSRA(DY As Range) Dim LH As Long HH = DY.Row LH = DY.Column With ActiveSheet If LH = 2 And HH > 3 Then .Calendar1.Visible = True .Calendar1.Top = DY.Offset(1, 0).Top .Calendar1.Left = Cells(ActiveCell.Row, ActiveCell.Column + 1).Left If Len(ActiveCell) = 0 Then .Calendar1 = Now() Else .Calendar1 = ActiveCell End If Else .Calendar1.Visible = False End If End With
|