- ©«¤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 ©ó 2013-6-24 16:18 ½s¿è
¦^´_ 1# vzcen
³oDEE¤u§@ªíª«¥óªºµ{¦¡½X- Option Explicit
- 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 < #9:00:00 AM# Or Time > #1:30: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
- Private Sub ²M°£Â¸ê®Æ()
- On Error GoTo Er
- If [Àç·~¤é] <> Date Then 'Àˬd ©w¸q¦WºÙ:"Àç·~¤é"ªºÈ
- Me.Names.Add "Àç·~¤é", Date '©w¸q¦WºÙ:"Àç·~¤é"ªºÈ¬°·í¤é
- If Weekday(Date, vbMonday) <= 5 Then Range([C8], [E8].End(xlDown)).Clear 'Àç·~¤é
- End If
- Exit Sub
- Er: '³B¸Ì: ¨S¦³©w¸q¦WºÙ:"Àç·~¤é"ªº¿ù»~
- Me.Names.Add "Àç·~¤é", Date '©w¸q¦WºÙ:"Àç·~¤é"ªºÈ¬°·í¤é
- Resume Next '¦^¨ì¿ù»~ªº¤U¤@Óµ{¦¡½X:Ä~Äò°õ¦æ
- End Sub
½Æ»s¥N½X
|
|