|
楼主 |
发表于 2013-3-20 16:04
|
显示全部楼层
Sub Opreate()
For i = 2 To 200
If (Hour(Sheets("数据").Cells(i, 3)) > 20 Or Hour(Sheets("数据").Cells(i, 3)) < 8) Then
Sheets("统计").Range("C14") = Sheets("数据").Cells(i, 2)
Sheets("统计").Range("D14") = Sheets("数据").Cells(i, 3)
Sheets("统计").Range("E14") = Sheets("数据").Cells(i, 4)
Sheets("统计").Range("F14") = Sheets("数据").Cells(i, 5)
Sheets("统计").Range("G14") = Sheets("数据").Cells(i, 6)
Sheets("统计").Range("H14") = Sheets("数据").Cells(i, 9)
Sheets("统计").Range("I14") = Sheets("数据").Cells(i, 10)
Sheets("统计").Range("J14") = Sheets("数据").Cells(i, 11)
If (Hour(Sheets("数据").Cells(i, 3)) = 8 And Minute(Sheets("数据").Cells(i, 3)) <= 30) Then
Sheets("统计").Range("C14") = Sheets("数据").Cells(i, 2)
Sheets("统计").Range("D14") = Sheets("数据").Cells(i, 3)
Sheets("统计").Range("E14") = Sheets("数据").Cells(i, 4)
Sheets("统计").Range("F14") = Sheets("数据").Cells(i, 5)
Sheets("统计").Range("G14") = Sheets("数据").Cells(i, 6)
Sheets("统计").Range("H14") = Sheets("数据").Cells(i, 9)
Sheets("统计").Range("I14") = Sheets("数据").Cells(i, 10)
Sheets("统计").Range("J14") = Sheets("数据").Cells(i, 11)
If (Hour(Sheets("数据").Cells(i, 3)) = 20 And Minute(Sheets("数据").Cells(i, 3)) >= 30) Then
Sheets("统计").Range("C14") = Sheets("数据").Cells(i, 2)
Sheets("统计").Range("D14") = Sheets("数据").Cells(i, 3)
Sheets("统计").Range("E14") = Sheets("数据").Cells(i, 4)
Sheets("统计").Range("F14") = Sheets("数据").Cells(i, 5)
Sheets("统计").Range("G14") = Sheets("数据").Cells(i, 6)
Sheets("统计").Range("H14") = Sheets("数据").Cells(i, 9)
Sheets("统计").Range("I14") = Sheets("数据").Cells(i, 10)
Sheets("统计").Range("J14") = Sheets("数据").Cells(i, 11)
If Sheets("数据").Cells(i, 3) = "" Then
GoTo endpoint
End If
End If
End If
End If
Next i
endpoint:
End Sub
这个是我的代码,执行起来不对 |
|