- ©«¤l
- 26
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 30
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office2019
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2018-10-12
- ³Ì«áµn¿ý
- 2022-7-25
|
¦^´_ 4# GBKEE
¤£¦n·N«ä¡A¦A¥t°µ¤@Ó¬ö¿ý15¤ÀK¶}°ª§C¦¬ªº¥¨¶°¤W¹J¨ì¤F§xÃø(¥Ñ©ó³o¸òì¼ÐÃD¤£§¹¥þ²Å¦X¡AY»Ý¥t¥DÃD¦A³Â·Ð§iª¾)
§Æ±æ¦b쥻³vµ§pºâªº¹Lµ{¤¤¡A±N¨C15¤ÀÄÁªº¶}°ª§C¦¬»ù®æ¬ö¿ý°_¨Ó¡A¹B¥Îo,h,l,c ¥|ÓÅܼÆ
½Ð°Ýn¦p¦ó¦b¨C15¤ÀÄÁ¬ö¿ý¨ºÃä¡An´«¦æ¬ö¿ý®É¤~±No,h,lÅܼÆÂk0¨Ã«·spºâ©O- Option Explicit
- Public uMode&, StartTime, EndTime
- Public MyBook As Workbook, Sht1 As Worksheet, Sht2 As Worksheet, Sht3 As Worksheet, xRow&
- Public o As Single, h As Single, l As Single c As Single
- Sub ¦@¥Î°Ñ·Ó()
- Set MyBook = ThisWorkbook
- Set Sht1 = MyBook.Sheets("¦hªÅÂŹÏ")
- Set Sht2 = MyBook.Sheets("³ø»ù¼Æ¾Ú")
- Set Sht3 = MyBook.Sheets("¦hªÅ¼Æ¾Ú")
- StartTime = "08:44:50" '¶}½L®É¶¡¡]´£¦¤Q¬í¶}©l¡A¤~¥i°O¿ý¶}½L¶q»ù¡^
- End Sub
- Sub ³ø»ù¹Bºâ()
- Dim xTime As Date
- Dim i As Long
-
- Call ¦@¥Î°Ñ·Ó '´ú¸Õ¥Î
- If Sht2.Range("H2") <> 1 Then '¶}½L±ø¥ó
- Sht2.Range("J2,J4,J5").ClearContents '²M°£¬ö¿ý¸ê®Æ
- Sht2.Range("K2") = Sht2.Range("I2") '§PÂ_»ù§ï¬°¶}½L»ù
- End If
- i = 1
-
- Do
- i = i + 1
-
- If Sht2.Cells(2, "J") = "¡ô" And Sht2.Cells(i, "H") <> 1 Then '¦h¤è¥[Á`
- Sht2.Range("J4") = Sht2.Range("J4") + Sht2.Range("D" & i)
- End If
- If Sht2.Cells(2, "J") = "¡õ" And Sht2.Cells(i, "H") <> 1 Then 'ªÅ¤è¥[Á`
- Sht2.Range("J5") = Sht2.Range("J5") + Sht2.Range("D" & i)
- End If
- If Sht2.Cells(i, "H") <> 1 Then
- Sht1.Cells(1, "C") = Sht2.Range("B" & i) '³ø»ù®É¶¡¶Ç°e¨ì¦hªÅÂŹÏ
- End If
- '***¥H¤U·s¼W15¤ÀK¬ö¿ý
- c = Sht2.Range("C" & i)
- If c > h Then h = c '§ó·s³Ì°ª»ù
- If c < l Then l = c '§ó·s³Ì§C»ù
- If o = 0 Then o = Sht2.Range("C" & i) Else o = o
- If l = 0 Then l = Sht2.Range("C" & i) Else l = l
- If h = 0 Then h = Sht2.Range("C" & i) Else h = h
- Sht2.Range("O2").Value = o '¶ñ¶}½L»ù
- Sht2.Range("P2").Value = h '¶ñ³Ì°ª»ù
- Sht2.Range("Q2").Value = l '¶ñ³Ì§C»ù
- Sht2.Range("R2").Value = c '¶ñ¦¬½L»ù
-
- If Sht1.Range("C1") > xTime Then '** ¤@¬í¹B¦æ¤@¦¸ **
-
- Call ¦hªÅ¬ö¿ý
- Call ¤ÀK¶}°ª§C¦¬
- End If
-
- Sht2.Cells(i, "H") = 1 '¹Bºâ¹Lªº¶i¦æ¼Ð°OÁקK«½Æ¹Bºâ
- Loop Until Sht2.Range("C" & i + 1) = 0 '°j°é°±¤î±ø¥ó
- End Sub
- Sub ¤ÀK¶}°ª§C¦¬()
- Call ¦@¥Î°Ñ·Ó '´ú¸Õ¥Î
- Dim xMinute As Integer
-
-
- xMinute = Int(Application.Text(Sht1.Range("C1") - #8:45:00 AM#, "[M]") / 15)
- '*** xMinute ¥H Time ¶Z 8:45 ªº¤ÀÄÁ¼Æ / 15 ¶Ç¦^ªº¾ã¼Æ
- '*** Time ¤p©ó 8:45 ±o¨ìt¼Æ
- If xMinute > -1 And Sht1.Range("C1") <= #1:45:00 PM# Then
- xMinute = xMinute + 3 '*** ±q²Ä2¦C¶}©l
- Sht2.Cells(xMinute, "O") = Sht2.Cells(2, "O")
- Sht2.Cells(xMinute, "P") = Sht2.Cells(2, "P")
- Sht2.Cells(xMinute, "Q") = Sht2.Cells(2, "Q")
- Sht2.Cells(xMinute, "R") = Sht2.Cells(2, "R")
- End If
-
- End Sub
½Æ»s¥N½X |
|