- ©«¤l
- 185
- ¥DÃD
- 47
- ºëµØ
- 0
- ¿n¤À
- 227
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN 7
- ³nÅ骩¥»
- ºX舰ª©
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-9-14
- ³Ì«áµn¿ý
- 2024-11-19
|
¦^´_ 1# cdkee
¹Á¸Õ¤F¤@¨Ç¨Ò¤l¡A¥u°µ¨ì«ö®É¶¡´¡¤J³¡¥÷¸ê®Æ
test2.rar (34.64 KB)
¦A½Ð±Ð¦U¤j¤j¡A³o¸Ì§ä¨ì"Â^¨ú³Ì°ª³Ì§C"¨Ò¤l ©M "§ä´M«ü©w®É¶¡´¡¤J¬ÛÃö¸ê®Æ"¨Ò¤l¡AÀ³¸Ó¦p¦óµ²¦X¤~¯à°µ¨ìn¨D¡AÁÂÁÂ!- 'Â^¨ú³Ì°ª³Ì§C
- Private Sub Worksheet_Calculate()
-
- Dim Rng As Range
-
- Static Msg As Boolean '¥H Static ³¯z¦¡«Å§iªºÅܼơA¦bµ{¦¡°õ¦æ´Á¶¡¡A·|¤@ª½«O¯d¤º®e¡C
-
- If Weekday(Date, vbMonday) > 5 Or Time < #5:46:00 PM# Or Time > #11:00:00 PM# Then Exit Sub '«DÀç·~¤é ©Î «DÀç·~®É¶¡
-
- If Msg = False Then
-
- ²M°£Â¸ê®Æ
-
- Msg = True
-
- End If
-
- With Cells(Rows.Count, "C").End(xlUp)
-
- If .Row = 7 Then
-
- Set Rng = .Offset(1)
-
- Else
-
- Set Rng = .Cells
-
- End If
-
- End With
-
- If Rng = "" Or Rng.Text <> Format([b5], "hh:mm") Then
-
- If Rng <> "" Then Set Rng = Rng.Offset(1)
-
- Rng = Format([b5], "hh:mm")
-
- Rng(1, 2) = [B6].Text
-
- Rng(1, 3) = [B6].Text
-
- ElseIf Rng.Text = Format([b5], "hh:mm") Then
-
- If [B6] > Rng(1, 2) Then Rng(1, 2) = [B6].Text
-
- If [B6] < Rng(1, 3) Then Rng(1, 3) = [B6].Text
-
- End If
-
- End Sub
½Æ»s¥N½X- '§ä´M©w®É¶¡´¡¤J¬ÛÃö¸ê®Æ
- Sub ¸ê®Æ¿é¤J()
- Dim E As Range
- '''''''''''''''''''''''''''''''''''''
- 'Dim Ar() 'Ar°}¦C -> ¦s¤J§Anªº¼Æ¾Ú
- 'Ar = Sheets("Table").Range("B2:D2").Value
- '''''''''''''''''''''''''''''''''''''
- Dim Ar(1 To 5) 'Ar°}¦C -> ¦s¤J§Anªº¼Æ¾Ú
- Ar(1) = [Table!B2]
- Ar(2) = [Table!C2]
- Ar(3) = [Table!D2]
- Ar(4) = [Table!E2]
- Ar(5) = [Table!A2]
- If Minute(Time) Mod 1 = 0 Then
- Set E = Sheets("1¤ÀK").Range("A:A").Find(TimeSerial(Hour(Time), Minute(Time), 0))
- E.Offset(0, 1).Resize(1, UBound(Ar)).Value = Ar 'Minute(Time) Mod 1=0 ¨C¤ÀÄÁ
-
- ElseIf Minute(Time) Mod 1 = 1 Then
- E.Offset(0, 1).Resize(1, UBound(Ar)).Value = Ar
- End If
- 'If Minute(Time) Mod 5 = 0 Then
- ' Set E = Sheets("5¤ÀK").Range("A:A").Find(TimeSerial(Hour(Time), Minute(Time), 0))
- ' E.Offset(0, 1).Resize(1, UBound(Ar)).Value = Ar 'Minute(Time) Mod 5=0 ¨C5¤ÀÄÁ
- 'End If
- 'If Minute(Time) Mod 15 = 0 Then
- ' Set E = Sheets("15¤ÀK").Range("A:A").Find(TimeSerial(Hour(Time), Minute(Time), 0))
- ' E.Offset(0, 1).Resize(1, UBound(Ar)).Value = Ar 'Minute(Time) Mod 15=0 ¨C15¤ÀÄÁ
- 'End If
- If Time <= #4:15:00 PM# Then Application.OnTime TimeValue(Format(Time, "hh:MM:00")) + #12:01:00 AM#, "ThisWorkbook.¸ê®Æ¿é¤J"
- ' *** #4:15:00 PM# ¤§«e®É¶¡°õ¦æµ{¦¡ ->¸ê®Æ¿é¤J
- Set E = Nothing '
- End Sub
½Æ»s¥N½X |
|