- ©«¤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
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-2-5 16:58 ½s¿è
¦^´_ 48# j1221
¦]µ{¦¡ªº FIND ªº®É¶¡ ¤£¤@©w¸¨¦b00,05,10,15....¤ÀÄÁªº®É¶¡¤W
¾ÉP¤u§@ªíAÄæFIND¤£¨ì¦Ó³y¦¨¿ù»~- Dim xTime As String '«Å§i¬°¦r¦ê«¬ºA ¶ÈThisWorkbook¼Ò²Õªºµ{§Ç¥i¥Î
- Private Sub Workbook_Open()
- Sheets("TXF1").[B7:P19000] = ""
- Sheets("MXF1").[B7:P19000] = ""
- Sheets("EXF").[B7:P19000] = ""
- Sheets("FXF").[B7:P19000] = ""
- Sheets("TWT").[B7:P19000] = ""
- Sheets("TWO").[B7:P19000] = ""
- If Time >= TimeValue("08:45:00") And Time <= TimeValue("13:45:00") Then
- '*** Àç·~®É¶¡¤º ¤£¤@©w¦b 00,05,10,15....ªº¤ÀÄÁ¤W ******
- xTime = Minute(Time) - Minute(Time) Mod 5 '¸¨¦b¤W¤@Ó 5¤ÀÄÁ ,Mod:¨â¼Æ¬Û°£ªº¾l¼Æ
- xTime = Format(TimeSerial(Hour(Time), xTime, 0), "h:mm:ss")
- change
- Else
- xTime = "08:45:00"
- Application.OnTime TimeValue(xTime), "ThisWorkbook.change"
- End If
- End Sub
- Private Sub change()
- Dim TimeRange As Range, Rng As Range, R As Range
- ' *** Time ®É¶¡ÂI¤£¤@©w¸¨¦b5¤ÀÄÁ¤W ********
- 'xTime¬°¸¨¦b 00,05,10,15....ªº¤ÀÄÁ¤Wªº®É¶¡,¥i½T©w¤@©w§ä±o¨ì
- Set TimeRange = Sheets("TXF1").[A:A].Find(xTime, LookIn:=xlValues) '§ï¬° ·j´M¤º®e
- Set Rng = TimeRange.Offset(, 1).Resize(, 11)
- Rng.Value = Sheets("Main").Range("C9:M9").Value
-
- Set TimeRange = Sheets("MXF1").[A:A].Find(xTime) '±µ¤UªºFind·|¨Ì¾Ú¤W¤@¦¸Findªº¿ï¶µ¨Ó·j´M
- Set Rng = TimeRange.Offset(, 1).Resize(, 11)
- Rng.Value = Sheets("Main").Range("C11:M11").Value
-
- Set TimeRange = Sheets("EXF").[A:A].Find(xTime)
- Set Rng = TimeRange.Offset(, 1).Resize(, 11)
- Rng.Value = Sheets("Main").Range("C12:M12").Value
-
- Set TimeRange = Sheets("FXF").[A:A].Find(xTime)
- Set Rng = TimeRange.Offset(, 1).Resize(, 11)
- Rng.Value = Sheets("Main").Range("C13:M13").Value
-
- Set TimeRange = Sheets("TWT").[A:A].Find(xTime)
- Set Rng = TimeRange.Offset(, 1).Resize(, 17)
- Rng.Value = Sheets("Main").Range("C2:U2").Value
-
- Set TimeRange = Sheets("TWO").[A:A].Find(xTime)
- Set Rng = TimeRange.Offset(, 1).Resize(, 20)
- Rng.Value = Sheets("Main").Range("C3:U3").Value
-
- If Time > TimeValue("13:45:00") Then Exit Sub
-
- xTime = Minute(Time) + 5 - Minute(Time) Mod 5 '¸¨¦b¤U¤@Ó5¤ÀÄÁ
- xTime = Format(TimeSerial(Hour(Time), xTime, 0), "h:mm:ss") '¸¨¦b 00,05,10,15....ªº¤ÀÄÁªº®É¶¡¤W
- ' Now + TimeValue("00:05:00") ->¤£¤@©w¬O¸¨¦b 00,05,10,15....ªº¤ÀÄÁ¤W
- Application.OnTime TimeValue(xTime), "ThisWorkbook.change" '½T¹ê¦b¤U¤@Ó5¤ÀÄÁÂI¤W°õ¦æ
- End Sub
½Æ»s¥N½X |
|