- ©«¤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 ©ó 2011-5-5 08:59 ½s¿è
¦^´_ 3# kimo5566
½Ð±N µ{¦¡½X ¶K©ó ¤@¯ë¼Ò²Õ¤º ¦sÀÉÃö³¬«á ¦A¶}±ÒÀɮ׮ɦ۰ʰõ¦æAuto_Openªºµ{§Ç- Option Explicit
- Sub Auto_Open()
- Dim T As Date
- T = Time '²{¦b®É¶¡
- Sheets("Sheet2").UsedRange.Offset(, 1).Select
- If T < #1:30:00 PM# Then Sheets("Sheet2").UsedRange.Offset(, 1).Clear
- '¦©ó¶}½L®É¶¡®É²M°£Â¦³¸ê®Æ
- If T < #9:00:00 AM# Then T = #9:00:00 AM# Else T = Now
- '²{¦b®É¶¡ ¦©ó¶}½L®É¶¡®É [³]©wªº®É¶¡] ¬° 9ÂI
- '²{¦b®É¶¡ ±ß©óµ¥©ó¶}½L®É¶¡®É [³]©wªº®É¶¡]¬° ²{¦b®É¶¡ '
- Application.OnTime T, "Ex" '©ó[³]©wªº®É¶¡]°õ¦æ Ex µ{§Ç
- End Sub
- Sub Ex()
- Dim Rng As Range, T As Date
- T = Time
- With Sheets("Sheet2")
- Set Rng = .Cells(2, Columns.Count).End(xlToLeft).Offset(, 1) '°O¿ý¤U¨Óªº¦ì¸m
- Rng.Resize(, 2) = T
- Rng.Offset(1).Resize(3, 2) = Sheets("Sheet1").Range("C1").Resize(3, 2).Value
- Rng.Resize(, 2).EntireColumn.AutoFit
- End With
- If Minute(T) Mod 10 Then '³]©w®É¶¡ªº¤ÀÄÁ ¤£¬O 10 ,20,30....
- T = TimeSerial(Hour(T), Minute(T) + (10 - Minute(T) Mod 10), 0)
- '½Õ¾ã³]©w®É¶¡ªº¤ÀÄÁ ¬O 10 ,20,30....
- Rng.Resize(, 2).NumberFormatLocal = "h:mm:ss AM/PM"
- Else
- T = T + #12:10:00 AM# '[³]©w®É¶¡]+10¤ÀÄÁ 10 ,20,30....
- End If
- If Time < #1:30:00 PM# Then '©ó¶}½L®É¶¡®É¤º
- Application.OnTime T, "Ex" '©ó[³]©wªº®É¶¡]°õ¦æ Ex µ{§Ç
- End If
- End Sub
½Æ»s¥N½X |
|