ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

DDE Â^¨ú¤ÀÄÁ³Ì°ª³Ì§C

ª©¤j±z¦n ¸ò±z³ø§i¤@¤U §Ú¤w±Nµ{¦¡¤W¶Ç¨Ì·Óª©¤j±zªº«ü¾É§ï¤FÀx¦s®æªº®É¶¡¹j¦¡  ´ú¦¡ªºµ²ªG¬°®É¶¡¹j¦¡ªº³¡¤À¬ÒÅã¥Ü¦¨0:00:00  ¥u­n»ù®æ¸õ°Ê CDEÄæ´N·|¤@ª½«ùÄò©¹¤U¬ö¿ý  Àɮתþ¤Wªº¤º®e¸Ì ³£¬O¦P¤@¤ÀÄÁ©ÒÅã¥Ü¥X¨Óªº   ·Q½Ð±Ðª©¤j³o­Ó³¡¤À¸Ó«ç»ò¿ì...³Â·Ð±z¤F~~

test1.rar (8.32 KB)

TOP

¦^´_ 11# vzcen
¦^´_ 9# GBKEE

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-6-24 16:23 ½s¿è

¦^´_ 11# vzcen
B5ªº®æ¦¡´N¤£¥²­×§ï¤F
B5ªº¤º®e·|Åã¥Ü¦¨102903, ¦¹¬°6¦ì¼Æ,½Ð°Ý B5, 10ÂI¥H«e·|Åã¥Ü¦¨95959, ¦¹¬°5¦ì¼Æ
  1. Option Explicit
  2. Private Sub Worksheet_Calculate()
  3.     Dim Rng As Range
  4.     Static Msg As Boolean    '¥H Static ³¯­z¦¡«Å§iªºÅܼơA¦bµ{¦¡°õ¦æ´Á¶¡¡A·|¤@ª½«O¯d¤º®e¡C
  5.    ' If Time < #10:28:00 AM# Or Time > #1:30:00 PM# Then Exit Sub   '«DÀç·~¤é ©Î «DÀç·~®É¶¡
  6.     If Msg = False Then
  7.         ²M°£Â¸ê®Æ
  8.         Msg = True
  9.     End If
  10.     With Cells(Rows.Count, "C").End(xlUp)
  11.         If .Row = 7 Then
  12.             Set Rng = .Offset(1)
  13.         Else
  14.             Set Rng = .Cells
  15.         End If
  16.     End With
  17.     'If Rng = "" Or Rng.Text <> Mid([B5].Text, 1, IIf(Len([B5]) = 6, 4, 3)) Then '¦pªG[B5]10ÂI¥H«eªºªº¼Æ­È¬O95959, 5¦ì¼Æ ¥Î¦¹µ{¦¡½X
  18.     If Rng = "" Or Rng.Text <> Mid([B5].Text, 1, 4) Then
  19.         If Rng <> "" Then Set Rng = Rng.Offset(1)
  20.         With Rng
  21.             .NumberFormatLocal = "@"
  22.              '.Cells = Mid([B5].Text, 1, IIf(Len([B5]) = 6, 4, 3))                 '¦pªG[B5]10ÂI¥H«eªºªº¼Æ­È¬O95959. 5¦ì¼Æ ¥Î¦¹µ{¦¡½X
  23.           .Cells = Mid([B5].Text, 1, 4)
  24.             .Cells(1, 2) = [B6].Text
  25.             .Cells(1, 3) = [B6].Text
  26.         End With
  27.    'ElseIf Rng.Text = Mid([B5].Text, 1, IIf(Len([B5]) = 6, 4, 3)) Then                '¦pªG[B5]10ÂI¥H«eªºªº¼Æ­È¬O95959. 5¦ì¼Æ ¥Î¦¹µ{¦¡½X
  28.     ElseIf Rng.Text = Mid([B5].Text, 1, 4) Then
  29.         If [B6] > Rng(1, 2) Then Rng(1, 2) = [B6].Text
  30.         If [B6] < Rng(1, 3) Then Rng(1, 3) = [B6].Text
  31.     End If
  32. End Sub
½Æ»s¥N½X
  1. Private Sub ²M°£Â¸ê®Æ()
  2.     On Error GoTo Er
  3.     If [Àç·~¤é] <> Date Then            'Àˬd ©w¸q¦WºÙ:"Àç·~¤é"ªº­È
  4.         Me.Names.Add "Àç·~¤é", Date     '©w¸q¦WºÙ:"Àç·~¤é"ªº­È¬°·í¤é
  5.         If Weekday(Date, vbMonday) <= 5 Then Range([C8], [E8].End(xlDown)).Clear ' ­×§ï 3#   
  6.     End If
  7.     Exit Sub
  8. Er:  '³B¸Ì: ¨S¦³©w¸q¦WºÙ:"Àç·~¤é"ªº¿ù»~
  9.      Me.Names.Add "Àç·~¤é", Date        '©w¸q¦WºÙ:"Àç·~¤é"ªº­È¬°·í¤é
  10.      Resume Next                        '¦^¨ì¿ù»~ªº¤U¤@­Óµ{¦¡½X:Ä~Äò°õ¦æ
  11. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

·PÁÂC_C_laiª©¤jªº¦^ÂÐ ¸g¹L´ú¸Õ«á®É¶¡¥i¥H¥¿±`ªº©¹¤U²Ö¿n¨C¤ÀÄÁªº³Ì¤j­È³Ì¤p­È ¯u¬O¤Ó·P¿E±z¤F ...¦ý¦³­Ó°ÝÃDÁÙ·Q½Ð±Ð¤@¤Uª©¤j­Ì ...¥Ñ©ó¨C®aªº¨t²Î³ø»ù®æ¦¡¤£¦P ¦³ªº¬Æ¦Ü¨S¦³´£¨Ñ®É¶¡ªºDDE³sµ²....©Ò¥H§Ú·Q½Ð°Ý¦³¿ìªk°µªº¨ì§Q¥Îµ{¦¡¥h¶]¥X®É¶¡¶Ü??  ¦]¬°­Y¹J¨ì¨S¦³´£¨Ñ®É¶¡DDEªº³sµ²ªº¨t²Î¨º»òµ{¦¡´N¤£¯à¶¶§Q°õ¦æ¤F  Àµ½ÐªO¤j­ÌÀ°¦£¸Ñµª ·PÁ±z­Ì¤F..........
¥t¥~....§Úª¾¹D§Ú³o¼Ë°Ý¦n¹³«ÜÄø  ¦ý..§Ú·Q....¾Ç²ß¤F¸Ñµ{¦¡ªº¹Lµ{¤¤ §Ú¤]¸Ó¾ÇµÛ¦³Ãö§»ªªº¦^ÂФ覡 ¦]¬°§Ú±`¬Ý¨ìªO¤j­Ìªº¦^ÂЦ³ 11# 6# °w¹ï¸Ó¤å©Ò´£¥Xªº¤º®e°µ¦^ÂÐ...©Ò¥H·Q°Ý°Ýª©¤j­Ì §Ú­Y­n¦^ÂÐ®É ­n«ö­þ¤@­Ó¶s¤~¬O°w¹ï¸Ó¤åªº¦^µª.....§Ú·Q³o¼Ë¦^ÂЦn¹³·|§ó¦³Â§»ª  ¦P®É¤]¬O¹ï¨¯­Wª©¤j­Ì©Ò°µªº¦^µª¤º®e§ó´L­«......¨þ¨þ

TOP

¦U¦ìª©¤j­Ì¦n §Ú¤U¤È®É¶}µÛ¹q¸£Åý¥¦¶]¤F¤@¤U....µo²{¤@­Ó©_©Çªº°ÝÃD.....´N¬O³ø»ù³nÅ骺®É¶¡»P»ù®æ¬O¦³¸õ°Êªº    ¦ý¬ODDEªº®É¶¡¦n¹³¦³®É·|°±¦í...´ú¸Õµ²ªG §Úªþ¤WÀÉ®×  ÀÉ®×¸Ì ®É¶¡µLªk³sÄòªºÅã¥Ü¨C¤@¤ÀÄÁ....¦n¤ñ17:44 ±µ¤U¨Ó´N±¼¨ì17:46   ¤S©ÎªÌ¬O18:14 ±µµÛ¸õ¨ì18:17 ......½Ð°Ý±jªÌª©¤j­Ì³o­Ó±¡ªp¬O­þÃä¥X²{°ÝÃD¶Ü??

Book1.rar (10.06 KB)

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2013-6-25 05:34 ½s¿è

¦^´_ 15# vzcen
°ò¥»¤W¡A®É¶¡¬O·|¥H¨C¤ÀÄÁ«ùÄò¦a°O¿ýªº¡A¦]¬°µ{¦¡±Ò°Ê«á Calculate ·|¤£°±¦a±½´y¡C
¦¹®É¡A¦pªG¹q¸£¥t¶}±Ò¤F§OªºÀ³¥Î³nÅé (¯Ó¥Î¸ê·½¤j)¦b¹B§@¦Ó¥e¾Ú¤F CPU ¡A¨º»ò¬O·|
¦³©Ò¼vÅTªº¡A©ÎªÌ¬O¤S¦P®É¶}±ÒÁA¤@­Ó¥H¤Wªº Excel Àɵ¥¡A¥ç·|¦³©Ò¼vÅT¡C
­Ó¤H¬O±`¸I¨ìÃþ¦ü¬ÛÃö°ÝÃD (¨é°ÓDDE³s½u«~½è¡B¹q¸£¹B§@Àô¹Òµ¥)  ¡A ¯Â¨Ñ°Ñ¦Ò¡C

P.S¡G µªÂйï¤è®É½ÐÂI¿ï "¦^´_" ¿ï¶s¡A§_«h·í¨Æ¤H·|¤£ª¾§A¦³§_¦^´_¡AÂI«ö "¦^´_" ¥ç¬O¤@ºØ§»ª¡C

TOP

¦^´_ 13# GBKEE


    ½Ð°Ýª©¥D
With Cells(Rows.Count, "C").End(xlUp)
        If .Row = 7 Then
            Set Rng = .Offset(1)  ½Ð°Ý³o¸Ìªº¥ÎªkÁÙ­ì:  Cells(Rows.Count, "C").End(xlUp).Offset(1)   ³o­Ó·N«ä¶Ü??
        Else
            Set Rng = .Cells       ½Ð°Ý³o¸Ìªº¥ÎªkÁÙ­ì:  Cells(Rows.Count, "C").End(xlUp).Cells   ³o­Ó·N«ä¶Ü?? ³o·|¤£Â_ªº¼W¥[Range ªº¤j¤p¬O¶Ü?
        End If
    End With

ÁÂÁ±zªº«ü¾É^^

TOP

¦^´_ 17# handsometrowa
¨S¿ù
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 13# GBKEE
¦^´_ 16# c_c_lai

·PÁ±jªÌª©¤j­Ì¤£§[ªº«ü¾É ­ì¨ÓDDE¬O³o¼Ë®É¶¡¤~µLªk±µÄò
¨º·Q½Ð±Ðª©¤j­Ì ­Y´úÃÑDDEªº®É¶¡ ¬°©P¤@¦Ü©P¤»     9:00PM-¹j¤éªº2:00AM
§Ú¬O¤£¬O­n±Nµ{¦¡05¦æ§ï¦¨   If Weekday(Date, vbMonday) > 6 Or Time < #9:00:00 PM# Or Time > #2:00:00 AM# Then Exit Sub     '«DÀç·~¤é ©Î «DÀç·~®É¶¡
µM«á31¦æªº§ï¦¨ If Weekday(Date, vbMonday) <= 6 Then Range([C8], [E8].End(xlDown)).Clear 'Àç·~¤é
¥Ñ5§ï¦¨6¬O«ü§«ô¤@¦Ü¤»ªº·N«ä¶Ü?   ¨º®É¶¡ªº³¡¤À³o¼Ë§ï¬O¹ïªº¶Ü?
³Â·Ð¦U¦ì¤j¤j­Ì¸Ñ´b¤F  ÁÂÁ±z­Ì~

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2013-6-27 06:55 ½s¿è
¦^´_  GBKEE
¦^´_  c_c_lai

·PÁ±jªÌª©¤j­Ì¤£§[ªº«ü¾É ­ì¨ÓDDE¬O³o¼Ë®É¶¡¤~µLªk±µÄò
¨º·Q½Ð±Ðª©¤j­Ì ...
vzcen µoªí©ó 2013-6-26 00:34

1. ¸Õ¸Õ¬Ý«Kª¾¾å¡I (¦]§A¬O¸ó¤éªº¡A ©Ò¥H±ø¥ó¶·¬° (±ø¥ó1 And ±ø¥ó2))
  1. Sub Test()
  2.     If Weekday(Date, vbMonday) > 6 Or (#9:00:00 PM# < #9:00:00 PM# And #9:00:00 PM# > #2:00:00 AM#) Then Exit Sub
  3.     '  If Weekday(Date, vbMonday) > 6 Or (#8:00:00 PM# < #9:00:00 PM# And #8:00:00 PM# > #2:00:00 AM#) Then Exit Sub
  4.    '  If Weekday(Date, vbMonday) > 6 Or (#12:00:00 AM# < #9:00:00 PM# And #12:00:00 AM# > #2:00:00 AM#) Then Exit Sub
  5.     '   If Weekday(Date, vbMonday) > 6 Or (#12:10:00 AM# < #9:00:00 PM# And #12:10:00 AM# > #2:00:00 AM#) Then Exit Sub
  6.    MsgBox "It's OK!"
  7. End Sub
½Æ»s¥N½X
2. 31¦æ ªº­×§ï¬O OK ¥i¦æªº!

TOP

        ÀR«ä¦Û¦b : ¡i°µ¤Hªº¶}©l¡j¨C¤@¤Ñ³£¬O¬G¤Hªº¶}©l¡A¨C¤@­Ó®É¨è³£¬O¦Û¤vªºÄµ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD