迟到不了的excel VB宏

Private Sub CommandButton1_Click()
列修改前 = "C"
列修改后 = "D"
列注释 = "E"
Dim 上班时间 As Date
上班时间 = "09:00:00"
Dim i As Integer
For i = 2 To 33
If Cells(i, 列修改前) > 上班时间 Then
Cells(i, 列修改后) = FormatDateTime(上班时间, vbShortTime)
Cells(i, 列注释) = "刚好没迟到!"
ElseIf Cells(i, 列修改前) <= 上班时间 And Cells(i, 列修改前) <> "" Then
Cells(i, 列修改后) = Cells(i, 列修改前)
End If
Next
End Sub

  

posted @ 2016-10-31 00:52  龙鸿轩  阅读(219)  评论(0)    收藏  举报