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

[µo°Ý] ¦p¦ó§Q¥ÎVBA«öÁä¡A¨Ó§ä¥X¹H¤Ï³W«hªº¸¹½X¡C

[µo°Ý] ¦p¦ó§Q¥ÎVBA«öÁä¡A¨Ó§ä¥X¹H¤Ï³W«hªº¸¹½X¡C

¸Ô²Ó°ÝÃD¤º®e       
³W«h1. ¦P¼Ëªº¸¹½X¤¤¡A¦bGÄæ¬Û¦Pªº»s³y¤é´Á¤¤¡AEÄ檺¨ì´Á¤é¤]¥²¶·¬Û¦P¡F       
³W«h2. ¦P¼Ëªº¸¹½X¤¤¡A·íGÄ檺»s³y¤é´Á¦³¦hºØ®É¡A«h¶}©l§PÂ_ ­YGÄæ¨Ì¥ý«á±Æ¦C«á¡A¬O§_ EÄ檺¨ì´Á¤é¤]¦³¨Ì¥ý«á¶¶§Ç±Æ¦C¡F       
­Y¹H¤Ï¥H¤W¨âºØ³W«h¥ô¤@¡A«hµø¬°²§±`¸¹½X¡A±N¼u¥Xµøµ¡¨ÃÅã¥Ü¦³­þ¨Ç¸¹½X¹H¤Ï¡C       
µù¡G¼u¥Xµøµ¡°£¤F·|«ü¥X¿ù»~ªº¸¹½X¥~¡A¦pªG¯à¦AÅã¥Ü¬O­þ¤@¤Ñªº»s³y¤é¦³°ÝÃD§ó¦n¡I       
       
¸Ô²Ó°ÝÃD½d¨Ò       
½Ð¨£Àɮפºªº "½d¨Ò»¡©ú­¶"¡C       
       
        ¥H¤W¡A°ÝÃD¨D¸Ñ¡AÁÂÁ¡I¤]§Æ±æ§ÚºÜºÉ©Ò¯àªº¤å·Nªí¹F¯àÅý¦U¦ì¤j¤j¬ÝÀ´¡CXD

¦p¦ó§Q¥ÎVBA«öÁä¡A¨Ó§ä¥X¹H¤Ï³W«h¸¹½X.rar (6.04 KB)

¦^´_ 22# yen956


    ·PÁÂyen956¤j¦A«×À°¦£­×§ï¡A¥Ø«e´ú¸Õ¤âÃ䪺¸ê®Æ¬O§¹¥þ¨S°ÝÃDªº¡F
§Ú¤£¤ÓÀ´VBAÅÞ¿è¡A©Ò¥H¤£ª¾¹D¬°¤°»ò·ÓµÛ²§±`1©M²§±`2ªº­ì«h¨«¡A«oÁÙ¬O¦³¨Ç¸ê®ÆÁÙ·|¦³°ÝÃD(¦p¥ý«eªºÄY­«¿ù»~1©M2)¡A
©Ò¥H¤£ª¾¹D¦³¨S¦³¥i¯à¤U¦¸ªº¸ê®Æ¤S·|¦³¤£¦Pªº·s°ÝÃD¡A¬O¦³ÂI¾á¤ß°Õ¡I¤£¹L²{ªp¦³À°§Ú¸Ñ¨M¨ì¤F´N¦n¡AÁÙ¬O«Ü·PÁÂyen956¤j¡A·íµMÁÙ¦³­ã¤j¡A¨âºØª©¥»§Ú³£³ßÅw¡A©Ò¥H³o¬O§Ú­º¦¸¤@¦¸±Ä¥Î¨âª©¥»¡F
³Ì«á¡A¦A¦¸ÁÂÁ¨â¦ì¦h¦¸­×§ï»PÀ°¦£¡I3Q

TOP

¦^´_ 21# RCRG
·PÁÂÁ¦A¤T´ú¸Õ,³y¦¨¤£«K, ÁٽХ]²[!!
³o­Óª©¥», ¿é¥X¦ì¸m¬G·N»P­ã¤j¿ù¶}, ¤è«K§A¤ñ¹ï.
¸Õ¸Õ¬Ý:
  1. '´¡¤J§Ç¸¹, ¥H«K«ì´_­ìª¬
  2. Sub ´¡¤J§Ç¸¹(LstR As Integer)
  3.     Dim I As Integer
  4.     For I = 2 To LstR
  5.         Cells(I, 10) = I
  6.     Next
  7. End Sub
  8. Sub test()
  9.     Dim LstR As Integer, LstR2 As Integer, sR As Integer, I As Integer, cnt As Integer
  10.     Dim maxDate As Date
  11.     Sheets("ÄY­«¿ù»~").Select
  12.     [H2:J65536] = ""
  13.     [H:J].Interior.ColorIndex = xlNone    '²M°£©³¦â
  14.     LstR2 = Cells(Rows.Count, 3).End(xlUp).Row
  15.     ´¡¤J§Ç¸¹ LstR:=LstR2      '´¡¤J§Ç¸¹, ¥H«K«ì´_­ìª¬
  16.     [A1].Resize(LstR2, 10).Sort _
  17.             Key1:=[C1], Order1:=xlAscending, _
  18.             Key2:=[G1], Order1:=xlAscending, _
  19.             Header:=xlYes
  20.     LstR = Cells(Rows.Count, 3).End(xlUp).Row
  21.     sR = 2
  22.     Do
  23.         cnt = sR
  24.         Do
  25.             '³W«h2.¸¹½X¬Û¦P, ¥B»s³y¤é¦³±Æ§Ç, «h¨ì´Á¤é¤]¥²¶·±Æ§Ç
  26.             If Cells(sR, 3) = Cells(sR + 1, 3) And Cells(sR, 5) > Cells(sR + 1, 5) Then
  27.                 Cells(sR, 9) = "²§±`2a"
  28.                 Cells(sR, 9).Interior.ColorIndex = 38
  29.             End If
  30.            '³W«h1.¸¹½X¬Û¦P, ¥B»s³y¤é¬Û¦P, ¦ý¨ì´Á¤é¤£¦P
  31.             If Cells(sR, 3) = Cells(sR + 1, 3) And Int(Cells(sR, 7)) = Int(Cells(sR + 1, 7)) And Cells(sR, 5) <> Cells(sR + 1, 5) Then
  32.                 Cells(sR, 8) = "²§±`1"
  33.                 Cells(sR, 8).Interior.ColorIndex = 8
  34.                 Cells(sR + 1, 8) = "²§±`1"
  35.                 Cells(sR + 1, 8).Interior.ColorIndex = 8
  36.             End If
  37.             sR = sR + 1
  38.         Loop Until Cells(sR, 3) <> Cells(sR + 1, 3) Or sR >= LstR    'ª½¨ì ¸¹½X¤£¦P ©Î ¸ê®Æµ²§À
  39.         For I = cnt To sR
  40.             maxDate = Application.Max(Cells(I, 5).Resize(sR - 1, 1))
  41.             '³W«h2.¸¹½X¬Û¦P, ¥B»s³y¤é¦³±Æ§Ç, «h¨ì´Á¤é¤]¥²¶·±Æ§Ç
  42.             If Cells(I, 3) = Cells(I + 1, 3) And Cells(I, 5) > maxDate Then
  43.                 Cells(I, 9) = "²§±`2b"
  44.                 Cells(I, 9).Interior.ColorIndex = 38
  45.             End If
  46.         Next
  47.     Loop Until sR >= LstR  'ª½¨ì¸ê®Æµ²§À
  48.     '«ì´_­ìª¬
  49.     [A1].Resize(LstR2, 10).Sort _
  50.             Key1:=[J1], Order1:=xlAscending, _
  51.             Header:=xlYes
  52. End Sub
½Æ»s¥N½X

TOP

¦^´_ 20# yen956


To yen956¤j   
ÄY­«²§±`³B²z§¹¡A´« "ÄY­«²§±`2" ¦³°ÝÃD¤F...XD¡A½Ð°Ñ¦Ò¤U¦CÀɮסA3Q¡I
20151223_¦p¦ó§Q¥ÎVBA«öÁä¡A¨Ó§ä¥X¹H¤Ï³W«h¸¹½X.rar (22.38 KB)

TOP

¦^´_ 19# RCRG
¨S¿ù, ¦]¿ù»~°T®§§ï©ñ¨ì³B, ²Ä11¦C§Ñ¤F§ï, ±N
    [J2:K65536] = ""
§ï¦¨
    [H2:J65536] = ""
§Y¥i.

p.s.
"¨ä¹ê¾ã½g¸ê®Æ³£·|¬O¥Î½Æ»s¹L¨Óªº¡A­ì«h¤W¤£·|¦³»~KEY"
¨º´N¬O­ì½Z´N¿ù?!§Oªº³æ¦ì°e¹L¨Óªº?¨º¤S¦ó¥²°£¿ù?

TOP

¥»©«³Ì«á¥Ñ RCRG ©ó 2015-12-22 12:27 ½s¿è

¦^´_ 18# yen956


    ·PÁÂyen956¤j­×§ï¸Ñµª¡A¤£¹L­×§ï§¹¤Ï¦ÓÅܦ¨¡A¦pªG§â¤é´Á§ï¬°¥¿½T¡A¦n¹³¤]¤£·|§â­ì¥»ªº "²§±`1&2" ¦r²´²M°£¤F©O¡I

Ãö©ó"¥H´î¤Ö¤H¬° Key In ¤Wªº¿ù»~?"¡A¨ä¹ê¾ã½g¸ê®Æ³£·|¬O¥Î½Æ»s¹L¨Óªº¡A­ì«h¤W¤£·|¦³»~KEY¡A¦³»~·|ªº¦a¤èÀ³¸Ó¬O§Ú¦Û¤vÀÉ®×Á|¨Ò¤£¦n¡A¦ýÁÙ¬O¥ýÁÂÁÂY¤j´£¿ô­ò¡I

TOP

¥»©«³Ì«á¥Ñ yen956 ©ó 2015-12-20 11:46 ½s¿è

¦^´_ 16# ­ã´£³¡ªL
¤j¤j©êºp!!¨Ó¤£¤Î¥Î¤j¤j·sª©´ú¸Õ´N¤W¶Ç!!

TOP

©êºp!!Á{¬É­È¨S§ì·Ç, ¤w­×§ï, ½Ð¦A´ú¸Õ¬Ý¬Ý!!
  1. '´¡¤J§Ç¸¹, ¥H«K«ì´_­ìª¬
  2. Sub ´¡¤J§Ç¸¹(LstR As Integer)
  3.     Dim I As Integer
  4.     For I = 2 To LstR
  5.         Cells(I, 1) = I
  6.     Next
  7. End Sub
  8. Sub test()
  9.     Dim LstR As Integer, LstR2 As Integer, sR As Integer, I As Integer, cnt As Integer
  10.     Dim minDate As Date
  11.     [J2:K65536] = ""
  12.     '²M°£©³¦â
  13.     [J:K].Interior.ColorIndex = xlNone
  14.     LstR2 = Cells(Rows.Count, 3).End(xlUp).Row
  15.     ´¡¤J§Ç¸¹ LstR:=LstR2      '´¡¤J§Ç¸¹, ¥H«K«ì´_­ìª¬
  16.     [A1].Resize(LstR2, 10).Sort _
  17.             Key1:=[C1], Order1:=xlAscending, _
  18.             Key2:=[G1], Order1:=xlAscending, _
  19.             Header:=xlYes
  20.     LstR = Cells(Rows.Count, 3).End(xlUp).Row
  21.     sR = 1
  22.     Do
  23.         sR = sR + 1
  24.         If sR = 2 Then GoTo Next1:
  25.         cnt = sR
  26.         Do
  27.             '³W«h1.¸¹½X¬Û¦P¥B»s³y¤é¬Û¦P, ¦ý¨ì´Á¤é¤£¦P
  28.             If Cells(sR, 3) = Cells(sR - 1, 3) And Int(Cells(sR, 7)) = Int(Cells(sR - 1, 7)) And Cells(sR, 5) <> Cells(sR - 1, 5) Then
  29.                 Cells(sR - 1, 9) = "¨ì´Á¤é²§±`1"
  30.                 Cells(sR - 1, 9).Interior.ColorIndex = 8
  31.                 Cells(sR, 9) = "¨ì´Á¤é²§±`1"
  32.                 Cells(sR, 9).Interior.ColorIndex = 8
  33.             End If
  34.             sR = sR + 1
  35.         Loop Until Cells(sR, 3) <> Cells(sR - 1, 3) Or sR > LstR    'ª½¨ì ¸¹½X¤£¦P ©Î ¸ê®Æµ²§À
  36.         '³W«h2. ¨ì´Á¤é¤]¥²¶·±Æ§Ç
  37.         If sR - cnt <= 1 Then GoTo Next1:
  38.         For I = cnt To sR - 2
  39.             minDate = Application.Min(Cells(I + 1, 5).Resize(sR - I - 1, 1))
  40.             If Cells(I, 5) > minDate Then
  41.                 Cells(I, 10) = "¨ì´Á¤é²§±`2"
  42.                 Cells(I, 10).Interior.ColorIndex = 38
  43.             End If
  44.         Next
  45. Next1:
  46.     Loop Until sR >= LstR  'ª½¨ì¸ê®Æµ²§À
  47.     '«ì´_­ìª¬, ¤è«K¬d®Ö
  48.     [A1].Resize(LstR2, 10).Sort _
  49.             Key1:=[A1], Order1:=xlAscending, _
  50.             Header:=xlYes
  51. End Sub
½Æ»s¥N½X
p.s.
±q »s³y¤é ºë·Ç¨ì"¤ÀÄÁ"¬Ý¨Ó, »s³y¤é¬O¥Ñ¹q¸£¦Û°Ê¿é¥Xªº,
¦ý ¨ì´Á¤é ¬°¦ó¤£¥Î 14# F ªº«Øij, §ï¥Î¤½¦¡¦Û°Ê¿é¤J,
¥H´î¤Ö¤H¬° Key In ¤Wªº¿ù»~?
¨ä¹ê, ¦³¹H¤Ï³W«h1¤Î³W«h2 ªº¿ù»~, «ç¥i¯à¨S¦³ ¨ì´Á¤é<»s³y¤é ªº¤H¬° Key In ¤Wªº¿ù»~!?
test.gif

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2015-12-20 11:03 ½s¿è

Sub ÀË´ú1()
Dim xD, xD1, R&, T$, TM1, TM2, i&, TT$
R = [C65536].End(xlUp).Row
[A:B].ClearContents
Set xD = CreateObject("Scripting.Dictionary")
Set xD1 = CreateObject("Scripting.Dictionary")
For i = 2 To R
¡@¡@T = Range("C" & i): TM1 = Range("E" & i): TM2 = Range("G" & i)
¡@¡@If T = "" Or IsDate(TM1) = 0 Or IsDate(TM2) = 0 Then GoTo 101
¡@
¡@¡@TM1 = Int(TM1): TM2 = Int(TM2)
¡@¡@If TM1 < xD(T) Then xD1(T & TM1) = "2.¨ì´Á¤é¥¼±Æ§Ç"
¡@¡@xD(T) = TM1
¡@
¡@¡@If xD(T & TM2) = 0 Then xD(T & TM2) = TM1
¡@¡@If xD(T & TM2) <> TM1 Then xD1(T & TM2) = "1.¨ì´Á¤é²§±`": GoTo 101
101: Next
¡@
For i = 2 To R
¡@¡@TT = ""
¡@¡@T = Range("C" & i): TM1 = Range("E" & i): TM2 = Range("G" & i)
¡@¡@If T = "" And TM1 = "" And TM2 = "" Then GoTo 102
¡@
¡@¡@If T = "" Then TT = "¡þ1.¸¹½X"
¡@¡@If Not IsDate(TM1) Then TT = TT & "" & "¡þ2.¨ì´Á¤é"
¡@¡@If Not IsDate(TM2) Then TT = TT & "¡þ3.»s³y¤é"
¡@¡@If TT <> "" Then Range("B" & i) = "*½ÐÀˬd_" & Mid(TT, 2) & "": GoTo 102
¡@
¡@¡@TM1 = Int(TM1): TM2 = Int(TM2)
¡@¡@If xD1(T & TM1) <> "" Then Range("A" & i) = xD1(T & TM1)
¡@¡@If xD1(T & TM2) <> "" Then Range("A" & i) = xD1(T & TM2)
102: Next
End Sub

TOP

¥»©«³Ì«á¥Ñ RCRG ©ó 2015-12-20 08:56 ½s¿è

¦^´_ 14# yen956


    ½Ð±Ð¤@¤Uyen956¤j¡A§Úµo²{¤F¤@­ÓÄY­«ªº°ÝÃD¡A

¤£¸Ó¥X²{²§±`ªº³ºµM¶]¥X¤@°ï²§±`¡A¦]¬°³ºµM·|¥h¤ñ¹ï¤£¦P¸¹½X(¥¿±`À³¸Ó¬O¦P¸¹½X¤U¥h¤ñ¸û)
¡A­Ë¬O¥Î­ã¤jª©¥»ªº«o¨S¦³³o­Ó°ÝÃD¡A¦³³Òyen956¤jÀ°§Ú¬Ý¤@¤U¦n¶Ü? ÁÂÁ¡I

20151220_¦p¦ó§Q¥ÎVBA«öÁä¡A¨Ó§ä¥X¹H¤Ï³W«h¸¹½X.rar (17.49 KB)

°ÝÃDÀɮצp¤W¡A¥i¥Hªº¸Ü­×§ïVBA«á¡A¦AÀ°§Ú¥þ³¡­«PO¤@¦¸Åý§Ú§ì¨ú¦n¶Ü? ¦A¦¸ÁÂÁ¤F¡I

TOP

        ÀR«ä¦Û¦b : ¡i»X½ªªº¦Û¥Ñ¡j¤H±`¦b¤°»ò³£¥i¥H¦Û¥Ñ¦Û¦bªº®É­Ô¡A«o³Q³oºØÀH¤ß©Ò±ýªº¦Û¥Ñ»X½ª¡AµêÂY®É¥ú¦Ó²@µLıª¾¡C
ªð¦^¦Cªí ¤W¤@¥DÃD