Private Sub Calendar1_Click()
Dim ShObj As Worksheet
Set ShObj = ThisWorkbook.Worksheets("Detail Task")
ShObj.Rows(7).Copy
ShObj.Rows(ActiveCell.Row).Select
ActiveCell.Insert shift:=xlDown
ShObj.Cells(ActiveCell.Row, 2) = Calendar1.Value
ShObj.Range(ShObj.Cells(ActiveCell.Row, 3), ShObj.Cells(ActiveCell.Row, 7)) = ""
Application.CutCopyMode = False
Unload Me
End Sub
Private Sub Calendar1_Initialize()
If IsDate(ActiveCell.Value) Then
Calendar1.Value = DateValue(ActiveCell.Value)
Else
Calendar1.Value = Date
End If
End Sub
|