Dim I As Integer '(µu¾ã¼Æ)¸ê®Æ«¬ºA'Public i As interger => ¥X²{¨Ï¥ÎªÌ«¬ºA©|¥¼©w¸q, ¥¿½T: Integer
Sub Ex()
Dim xTime As Date
If Time >= #8:45:00 AM# And Time <= #1:30:00 PM# Then
With Sheets("RTD").Cells(I + 3, "T").Resize(, 6)
.Offset(-2).Value = .Offset(-2).Value '¤W¤@¦C:±N¤½¦¡¦^¼ÆÈ
'TÄ椽¦¡=IF(ISERROR(MATCH(U2,P:P,0)),"",MATCH(U2,P:P,0))
.Range("A1") = "=MATCH(RC[1],R3C[-19]:R70000C[-19],1)+2"
'XÄ椽¦¡=IF(W2="","",IF(W2>54,-1,IF(W2<6,1,"")))
.Range("E1") = "=SUM(INDIRECT(""B""&R[-1]C[-4]+1):INDIRECT(""B""&RC[-4]))"
'YÄ椽¦¡=IF(ISERROR(INDIRECT("R"&T2)),Y1,INDIRECT("R"&T2))
.Range("F1") = "=SUM(INDIRECT(""C""&R[-1]C[-5]+1):INDIRECT(""C""&RC[-5]))"
'WÄ椽¦¡=IF(ISERROR(INDIRECT("O"&T2)),"",INDIRECT("O"&T2))
.Range("C1") = "=RC[-2]-R[-1]C[-2]"
'XÄ椽¦¡=IF(W2="","",IF(W2>54,-1,IF(W2<6,1,"")))
'.Range("E1") = "=IF(RC[-1]="""","""",IF(RC[-1]>54,-1,IF(RC[-1]<6,1,"""")))"
'YÄ椽¦¡=IF(ISERROR(INDIRECT("R"&T2)),Y1,INDIRECT("R"&T2))
'.Range("F1") = "=IF(ISERROR(INDIRECT(""R""&RC[-5])),R[-1]C,INDIRECT(""R""&RC[-5]))"
'.Resize(, 6) = .Resize(, 6).Value '±N¤½¦¡¦^¼ÆÈ
End With
I = I + 1
xTime = Time + #12:01:00 AM#
If xTime <= #1:45:00 PM# Then Application.OnTime xTime, "EX"
ElseIf Time < #8:45:00 AM# Then
Application.OnTime #8:45:00 AM#, "EX"
Else
MsgBox "®É¶¡¤w¹L"
End If
End Sub
¤W±¬O§Ú¥Ø«e¦b°õ¦æµ{¦¡ªºµ{¦¡½X¡A½Ð°Ý¤@¤Uª©¤W«e½ú¡A¦pªGn±N¤Wzµ{¦¡½X§ï¦¨¤@¼Ë¦b8:45-13:45¤À°õ¦æ¡A¦ý°õ¦æ±ø¥ó§ï¬°¨C¤ÀÄÁªº¬í¼Æ¨ì57¬í°õ¦æµ{¦¡¡A¨ì¤U¤ÀÄÁªº01¬í±N¤W¤@Ó°õ¦æªº¤½¦¡¼g¦¨È¡A³o¼Ën¦p¦ó§ó§ïµ{¦¡½X©O?
¨Ò¡F8:45:57¬í°õ¦æ¥H¤U¥\¯à¡A8:46:01¬í±N8:45:57¬í°õ¦æªº¤½¦¡ÂনȡA8:46:57¬í¤@¼Ë°õ¦æµ{¦¡¡A8:47:01¬í¤@¼ËÂà´«¦¨È¡A¨Ì¦¹Ãþ±À¡A¤@ª½°õ¦æ¨ì13:45¡A³o¼Ëªºµ{¦¡½Xn¦p¦ó§ó§ï?
.Range("A1") = "=MATCH(RC[1],R3C[-19]:R70000C[-19],1)+2"
'XÄ椽¦¡=IF(W2="","",IF(W2>54,-1,IF(W2<6,1,"")))
.Range("E1") = "=SUM(INDIRECT(""B""&R[-1]C[-4]+1):INDIRECT(""B""&RC[-4]))"
'YÄ椽¦¡=IF(ISERROR(INDIRECT("R"&T2)),Y1,INDIRECT("R"&T2))
.Range("F1") = "=SUM(INDIRECT(""C""&R[-1]C[-5]+1):INDIRECT(""C""&RC[-5]))"
'WÄ椽¦¡=IF(ISERROR(INDIRECT("O"&T2)),"",INDIRECT("O"&T2))
.Range("C1") = "=RC[-2]-R[-1]C[-2]"
'XÄ椽¦¡=IF(W2="","",IF(W2>54,-1,IF(W2<6,1,"")))
'.Range("E1") = "=IF(RC[-1]="""","""",IF(RC[-1]>54,-1,IF(RC[-1]<6,1,"""")))"
'YÄ椽¦¡=IF(ISERROR(INDIRECT("R"&T2)),Y1,INDIRECT("R"&T2)) |