- ©«¤l
- 31
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 58
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- taipe
- µù¥U®É¶¡
- 2011-4-29
- ³Ì«áµn¿ý
- 2014-1-20
|
¦^´_ 5# GBKEE
ªO¥D§A¦n
³o¬O§Ún¶Kªºµ{¦¡½X
Sub SyncData()
On Error GoTo ErrorHandler
Dim i As Integer
Dim j As Integer
If Not ((Sheet1.Cells(10, 3) = "13:44:59") Or (Sheet1.Cells(10, 3) = "13:45:00")) Then
i = Round(DateDiff("s", TimeValue("09:00:00"), TimeValue(Sheet1.Cells(3, 3))) / 60 / 5, 0) + 1
Do While (Sheet3.Cells(i, 1) <> "")
If (Sheet3.Cells(i, 1) = Mid(Sheet1.Cells(3, 3), 1, 5)) Then
Sheet3.Cells(i, 2) = Sheet1.Cells(20, 3)
Sheet3.Cells(i, 3) = Sheet1.Cells(7, 3)
Exit Do
End If
i = i + 1
Loop
i = Round(DateDiff("s", TimeValue("09:00:00"), TimeValue(Sheet1.Cells(3, 3))) / 60, 0) + 1
j = i
Do While (Sheet3.Cells(i, 6) <> "")
If (Sheet3.Cells(i, 6) = Mid(Sheet1.Cells(3, 3), 1, 5)) Then
Sheet3.Cells(i, 7) = Sheet1.Cells(4, 3)
Sheet3.Cells(i, 8) = Sheet1.Cells(11, 3)
Exit Do
End If
i = i + 1
Loop
If (InStr(5, Sheet1.Cells(10, 3), ":30") > 0) Then
ActiveWorkbook.Save
End If
End If
Exit Sub
ErrorHandler:
'MsgBox "eMail to E.Y. ~ " + Err.Description
End Sub
Sub EraseData()
Sheet3.Activate
Sheet3.Range("B2:C55").Select
Selection.ClearContents
Sheet3.Range("G2:H271").Select
Selection.ClearContents
Sheet1.Activate
ActiveWorkbook.Save
End Sub |
|