- ©«¤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 ©ó 2016-10-8 16:18 ½s¿è
¦^´_ 7# blue2263
¸Õ¸Õ¬Ý- Option Explicit
- Public uMode&, xTime(1 To 5)
- Public MyBook As Workbook, Sht1 As Worksheet, Sht2 As Worksheet, xRow&, §ó·s§PÂ_
- Sub ¶}©l°õ¦æ()
- Set MyBook = ThisWorkbook
- xTime(1) = #3:00:00 AM# '¹q¤l½L ¦¬½L®É¶¡ "03:00:00"
- xTime(2) = #8:44:00 AM# '¦½L ¶}½L®É¶¡ "08:44:00"
- xTime(3) = #1:45:00 PM# '¦½L ¦¬½L®É¶¡ "13:45:00"
- xTime(4) = #2:35:00 PM# '¹q¤l½L ¶}½L®É¶¡ "14:35:00"
- If Time <= #11:59:59 AM# Then
- Set Sht1 = MyBook.Sheets("a") '¦½L
- If Time <= xTime(1) Or Time >= xTime(2) Then
- If Time <= xTime(1) Then Set Sht1 = MyBook.Sheets("b") '¹q¤l½L
- ³]©w
- ¦Û°Ê°O¿ý
- Else '¦½L
- xTime(5) = xTime(2) - #12:00:05 AM#
- Application.OnTime xTime(5), "³]©w"
- xTime(5) = xTime(2) + #12:00:10 AM#
- Application.OnTime xTime(5), "¦Û°Ê°O¿ý"
- End If
- Else
- Set Sht1 = MyBook.Sheets("B") '¹q¤l½L
- If Time <= xTime(3) Or Time >= xTime(4) Then
- If Time <= xTime(3) Then Set Sht1 = MyBook.Sheets("a") '¦½L
- ³]©w
- ¦Û°Ê°O¿ý
- Else
- xTime(5) = xTime(4) - #12:00:05 AM#
- Application.OnTime xTime(5), "³]©w"
- xTime(5) = xTime(4) + #12:00:10 AM#
- Application.OnTime xTime(5), "¦Û°Ê°O¿ý"
- End If
- End If
- End Sub
- Sub ¦Û°Ê°O¿ý()
- Dim Msg As Boolean
- If uMode = 0 Then Exit Sub
- If Time <= #11:59:59 AM# Then
- If Time > xTime(1) And Time < xTime(2) Then
- Msg = True
- xTime(5) = xTime(2) - #12:00:05 AM#
- Application.OnTime xTime(5), "³]©w"
- xTime(5) = xTime(2) + #12:00:10 AM#
- Application.OnTime xTime(5), "¦Û°Ê°O¿ý"
- Application.StatusBar = "¦½L ¶}½L®É¶¡" & xTime(5)
- End If
- Else
- If Time > xTime(3) And Time < xTime(4) Then
- Msg = True
- xTime(5) = xTime(2) - #12:00:05 AM#
- Application.OnTime xTime(5), "³]©w"
- xTime(5) = xTime(2) + #12:00:10 AM#
- Application.OnTime xTime(5), "¦Û°Ê°O¿ý"
- Application.StatusBar = "¹q¤l½L ¶}½L®É¶¡" & xTime(5)
- End If
- End If
- If Msg Then
- Application.DisplayStatusBar = True '¥´¶}ª¬ºA¦C¡C
- 'Application.StatusBar = "¦¬½L"
- ActiveWorkbook.Save '·í«e¤u§@ªíÀx¦s
- Exit Sub
- End If
- '¨C¤ÀÄÁ°O¿ý----------------------------------------------------------
- ' If Second(Time) = 0 Then
- xRow = Sht1.Range("A8").End(xlDown).Row '¥Ñ¤W©¹¤U§ä
- Sht1.Range("B1") = xRow + 1
- Sht1.Range("A10").EntireRow.Insert
- Sht1.Range("A10:CZ10").Value = Sht1.Range("A9:CZ9").Value
- Sht1.Range("b10") = Time
- ' End If
- '********¨C¤ÀÄÁ°O¿ý- µe±¤£·|¤£°±°{Ã{¤F****************
- xTime(5) = TimeSerial(Hour(Time), Minute(Time) + 1, 0)
- Application.OnTime xTime(5), "¦Û°Ê°O¿ý" '¨C¤À»¼°j¤@¦¸
- End Sub
- Sub ³]©w()
- uMode = 1
- Sht1.Select
- Sht1.Range("a9") = Date '¤é´Á
- Application.DisplayStatusBar = False 'Ãö³¬ª¬ºA¦C¡C
- End Sub
- Sub ¶}©l()
- ¶}©l°õ¦æ
- End Sub
- Sub °±¤î°õ¦æ()
- uMode = 0
- Application.DisplayStatusBar = True '¥´¶}ª¬ºA¦C¡C
- Application.StatusBar = "¤v°±¤î°õ¦æ"
- If Not IsEmpty(xTime(5)) And Time < xTime(5) Then
- Application.OnTime xTime(5), "¦Û°Ê°O¿ý", Schedule:=False '°±¤î¥¼°õ¦æªº OnTime±Æµ{
- End If
- End Sub
½Æ»s¥N½X |
|