- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 18# dreamsway
¸Õ¸Õ¬Ý- Option Explicit
- Const K = #12:15:00 AM#
- Const ¶}½L = #8:45:00 AM#
- Sub k_15()
- Dim i As Long, Ti(1 To 3) As Long, ¦¨¥æ»ù As Double
- Dim xTime As Date, AR(1 To 6)
- AR(1) = "®É¶¡": AR(2) = "¶}½L": AR(3) = "³Ì°ª": AR(4) = "³Ì§C": AR(5) = "¦¬½L": AR(6) = "¦¨¥æ¶q"
- With Sheets("¦hªÅ¼Æ¾Ú")
- .UsedRange.Clear '²M½L
- .[A1].Resize(, UBound(AR)) = AR 'µ¹¼ÐÀY
- End With
- xTime = ¶}½L + IIf(K = #12:01:00 AM#, 0, K) '²Ä¤@ÓK®É¶¡ÂI
- Ti(1) = Application.Text(xTime, "[S]") 'K®É¶¡ÂIªº¬í¼Æ
- Ti(3) = 0 'K¼Æ¦¸
- i = 0 '«ü©w³ø»ùªº¦C¸¹ '
- AR(1) = Format(xTime, "hh:mm"): AR(2) = 0: AR(3) = 0: AR(4) = 0: AR(5) = 0: AR(6) = 0 '°}¦C«·sµ¹È
- Do
- With Sheets("³ø»ù¼Æ¾Ú").Range("b2").Offset(i)
- ¦¨¥æ»ù = .Range("B1")
- Ti(2) = Application.Text(.Cells.Offset(1), "[S]") '.Cells.Offset(1) -> ¤U¤@Ó³ø»ù®É¶¡¬í¼Æ
- AR(2) = IIf(AR(2) = 0, ¦¨¥æ»ù, AR(2)) '¶}½L
- AR(3) = IIf(¦¨¥æ»ù >= AR(3), ¦¨¥æ»ù, AR(3)) '³Ì°ª
- AR(4) = IIf(AR(4) = 0, ¦¨¥æ»ù, IIf(¦¨¥æ»ù <= AR(4), ¦¨¥æ»ù, AR(4))) '³Ì§C
- AR(5) = ¦¨¥æ»ù '¦¬½L
- AR(6) = AR(6) + .Range("C1") '¦¨¥æ¶q
- If Ti(2) > Ti(1) Then '¤U¤@Ó³ø»ù®É¶¡¬í¼Æ > KÂI®É¶¡ªº¬í¼Æ
- Sheets("¦hªÅ¼Æ¾Ú").Range("A2").Offset(Ti(3)).Resize(, UBound(AR)) = AR 'k®É¶¡ÂI¾É¤J°}¦C
- xTime = xTime + K '¤U¤@ÓK®É¶¡ÂI
- Ti(1) = Application.Text(xTime, "[S]") '¤U¤@Ó K ÂI®É¶¡ªº¬í¼Æ
- Ti(3) = Ti(3) + 1 'K¼Æ¦¸+1
- AR(1) = Format(xTime, "hh:mm"): AR(2) = 0: AR(3) = 0: AR(4) = 0: AR(5) = 0: AR(6) = 0 '°}¦C«·sµ¹È
- Else
- If .Cells.Offset(1) = "" And CDate(.Cells.Value) = CDate(#1:45:00 PM#) Then
- '¤U¤@Ó³ø»ù®É¶¡="" ¥B ³ø»ù®É¶¡=¦¬½L®É¶¡
- Sheets("¦hªÅ¼Æ¾Ú").Range("A2").Offset(Ti(3)).Resize(, UBound(AR)) = AR 'k®É¶¡ÂI¾É¤J°}¦C
- Exit Do 'Â÷¶}°j°é
- ElseIf .Cells.Offset(1) = "" Then '³o±ø¥ó¤£¦¨¥ß (¤U¤@Ó³ø»ù®É¶¡="" ¥B ³ø»ù®É¶¡=¦¬½L®É¶¡ )
- ¶×¤JAPI³ø»ù¤å¦rÀÉ
- End If
- End If
- End With
- DoEvents '¼È°±°õ¦æ¡A¥H«KÅý§@·~¨t²Î¥i¥H³B²z¨ä¥¦ªº¨Æ¥ó
- i = i + 1 '³ø»ùªº¦C¸¹ +1
- Loop
- End Sub
½Æ»s¥N½X |
|