|
本帖最后由 yhq302 于 2014-2-11 23:19 编辑
每天7:59,15:59,23:59把2个单元格的数累加到另外的单元格,但到点不执行,请哪位高手老师给指点下
Sub cudang()
If Cells(10, 1) - Cells(10, 2) = 0 Then
If Cells(2, 3) = "甲" Then
Cells(12, 2) = Cells(12, 2) + Cells(2, 6)
Cells(12, 3) = Cells(12, 3) + Cells(2, 7)
ElseIf Cells(2, 3) = "乙" Then
Cells(13, 2) = Cells(13, 2) + Cells(2, 6)
Cells(13, 3) = Cells(13, 3) + Cells(2, 7)
ElseIf Cells(2, 3) = "丙" Then
Cells(14, 2) = Cells(14, 2) + Cells(2, 6)
Cells(14, 3) = Cells(14, 3) + Cells(2, 7)
ElseIf Cells(2, 3) = "丁" Then
Cells(15, 2) = Cells(15, 2) + Cells(2, 6)
Cells(15, 3) = Cells(15, 3) + Cells(2, 7)
End If
Else
Cells(12, 2) = 0
Cells(12, 3) = 0
Cells(13, 2) = 0
Cells(13, 3) = 0
Cells(14, 2) = 0
Cells(14, 3) = 0
Cells(15, 2) = 0
Cells(15, 3) = 0
End If
Call auto_open
End Sub
Private Sub auto_open()
Application.OnTime TimeValue("7:59:00"), "cudang"
Application.OnTime TimeValue("15:59:00"), "cudang"
Application.OnTime TimeValue("23:59:00"), "cudang"
End Sub
|
|