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

[µo°Ý] ·Q½Ð±Ð¨âµ§¤£¦P¸ê®Æ¦p¦ó¾ã¦X¦¨¤@µ§?(¥H¸Ñ¨M)

[µo°Ý] ·Q½Ð±Ð¨âµ§¤£¦P¸ê®Æ¦p¦ó¾ã¦X¦¨¤@µ§?(¥H¸Ñ¨M)

¥»©«³Ì«á¥Ñ ivan731129 ©ó 2011-2-22 10:52 ½s¿è

¥Ø«e¤p§Ì¦b¾ã¦X¸ê®Æ¡A·Q¸ß°ÝÃö©ó¾ã¦X¤£¦PÃþ«¬Àɮתº°ÝÃD¡C
¥H¤U¬O´ú¸Õ®É¼gªº¦ý¬O¦n¹³¦³«Ü¤j°ÝÃD¡A·Q½Ð¦U¦ì«e½ú­ÌÀ°¦£¡C

Sub ¦X¨Ö()
Dim dHead As Range, dDataCunt As Long, i As Long, dText As String
Set dHead = Range("¦X¨Ö¹ï¶H")

dDataCunt = dHead.Cells(65536, 1).End(xlUp).Row - dHead.Row
For i = dDataCunt To 1 Step -1

    If dHead.Cells(i + 1, 1).Value = dHead.Cells(i, 1).Value And _
       dHead.Cells(i + 1, 2).Value = dHead.Cells(i, 2).Value Then

       dHead.Cells(i, 3).Value = dHead.Cells(i, 3).Value & "¡D" & dHead.Cells(i + 1, 3).Value
       dHead.Cells(i + 1, 3).EntireRow.Delete

    End If
Next i
dHead.Select: Beep
End Sub

test date.rar (8.01 KB)
¨º¸ê®Æ³¡¤À¦pªþÀÉ(­ìÀɸê®Æ¦]¬°ÆZÃe¤j©Ò¥H¨è·N§Ë¤@­Ó¤p¸ê®Æ¥h´ú¸Õ¡C)
¥D­n¬O¤½¥q²£¶q¸ê®Æ©M¤½¥q¦a§}¡A¨º¦a§}¸ê®Æ¬O¦a°Ï¤½¥q¦a§}³o¼Ë¡A©Ò¥H­n§â²£¶q¸ê®Æ«á­±ª½±µ¥[¤W¤½¥qªº¬ÛÃö¦a§}¸ê®Æ³o¼Ë
¨º²£¶qªº¤½¥q¤ñ¸û¤Ö¡A©Ò¥H¦a§}¸ê®Æ­n¬O©Ò¹ïÀ³ªº²£¶q¸ê®Æ¨S¦³´N¤£·|¼W¥[µ§¼Æ¡C
´N­ì¥»¬O
a.¤½¥q ½s¸¹ ²£¶q b.¤½¥q ¦a§} ¹q¸Ü
¾ã¦X¦¨ >>¤½¥q ½s¸¹ ²£¶q ¦a§} ¹q¸Ü
¨º±ø¥ó¬O¥H¤U¡G
1.¤½¥q¸ê®Æ¦P£¸®a¥u¨ú¦P¤@¤Ñ²£¶q³Ì¤j£¸µ§¡A©Ò¥H¾ã¦X«á·|¥X²{¦P®a¤½¥q¦³¨â¤Ñ²£¶q¦P½s¸¹³o¼Ë¡C
2.¨º½s¸¹­ì¥»¦³­­©w¥u¨ú­þ´Xµ§¡A¨º­ì¥»¬O·Q»¡¥ý¥Î¥¨¶°¾ã¦X¥X¤@µ§¸ê®Æ«á¦A¥h¿z¿ï¡A
¨º­n¬O¥i¥H¦b¾ã¦X®É´N¿ï©w­n¨ú­þ´X¶µ´N«ô°U¦U¦ì«e½úÀ°¦£¡C


¦]¬°©È¤pÀɮפÓ²²¤¡A©Ò¥Hªþ¤W¥D­nªº®æ¦¡¼ÐÃD°Ñ¦Ò¤§ ¥D­n¶µ¥Ø.rar (4.72 KB)

¦^´_ 1# ivan731129
  1. Sub Ex()
  2. Dim A As Range
  3. Set d = CreateObject("Scripting.Dictionary")
  4. d("¤½¥q") = Array("¤½¥q", "½s¸¹", "²£¶q", "¦a§}", "¹q¸Ü")
  5. With Sheet2
  6.    For Each A In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp))
  7.      d(A.Value) = Array(A.Value, "", 0, A.Offset(, 1).Value, A.Offset(, 2).Value)
  8.    Next
  9. End With
  10. With Sheet1
  11.    For Each A In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp))
  12.    ar = d(A.Value)
  13.      temp = ar(2): ar(1) = A.Offset(, 1).Value
  14.      If A.Offset(, 2) > temp Then ar(2) = A.Offset(, 2)
  15.      d(A.Value) = ar
  16.    Next
  17. End With
  18. Sheet5.[A1].Resize(d.Count, 5) = Application.Transpose(Application.Transpose(d.items))
  19. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ ivan731129 ©ó 2011-2-18 11:00 ½s¿è

¥ý·PÁÂHsieh¤j¦^À³¡A¦ý³oÃä¸Ñ¥Xªºµ²ªG¦ü¥G·|Åܦ¨¥H¦a§}¬°¥D?¦]¬°¬Ý¿é¥Xµ²ªGÅܦ¨¨S¦³²£¶q¸ê®Æªº¤½¥q¤]¤@°_¼W¥[¤F¡C¯à°÷¥u¼W¥[¦³²£¶q¨Ã¥B¦³¦³¦a§}ªº¶°¦X¶Ü?

¦]¬°µ²ªGÅܦ¨³æ®a¤½¥q¥u²£¥X£¸µ§²£¶q¸ê®Æ¡C¨º§Ú¤W­±¦³­×§ï¦¨­n¬O§Ú¦P¤@®a¤½¥q·|¦³¦h¤Ñ¦P²£«~½s¸¹§Ú­n²£¥X¦h¤Ñ²£¶q¦P¤@½s¸¹®É­n¦p¦ó¥h§ó§ï©O?

¨º¦]¬°§Ú¤§«á­n­×§ï¨ì¤ñ¸ûÃe¤j¸ê®Æ¤W¡A·Q¦b«ô°U«e½ú­Ì¼W¥[­n¬O§Ú­n­×§ï®É­nª`·N´¡¤Jªºª`¸Ñ¡C·PÁ«e½ú­Ì!

TOP

¦^´_ 3# ivan731129
  1. Sub Ex()
  2. Dim A As Range
  3. Set d = CreateObject("Scripting.Dictionary")
  4. Set d1 = CreateObject("Scripting.Dictionary")
  5. d1("¤½¥q") = Array("¤½¥q", "½s¸¹", "²£¶q", "¦a§}", "¹q¸Ü") '¦X¨Ö«á¼ÐÃD¦C¤å¦r
  6. With Sheet2
  7.    For Each A In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp))
  8.      d(A.Value) = Array(A.Offset(, 1).Value, A.Offset(, 2).Value) '±N«È¤á¸ê®ÆÀx¦s
  9.    Next
  10. End With
  11. With Sheet1
  12.    For Each A In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp))
  13.    If IsEmpty(d1(A & A.Offset(, 3))) Then '¥H®É¶¡»P«È¤á¦WºÙ¬°¯Á¤ÞÀx¦s
  14.       d1(A & A.Offset(, 3)) = Array(A.Value, A.Offset(, 1).Value, A.Offset(, 3).Value, d(A.Value)(0), d(A.Value)(1))
  15.      Else
  16.      ar = d1(A & A.Offset(, 3))
  17.      If A.Offset(, 3).Value > ar(2) Then ar(2) = A.Offset(, 3).Value
  18.      d1(A & A.Offset(, 3)) = ar
  19.     End If
  20.    Next
  21. End With
  22. Sheet5.[A1].Resize(d1.Count, 5) = Application.Transpose(Application.Transpose(d1.items))
  23. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦A¦¸·PÁÂHsieh«e½ú¡A¦ý¬O§Ú¦³°ÝÃD¹ï©ó¸Ì­±«Å§iªº
d(A.Value) = Array(A.Offset(, 1).Value, A.Offset(, 2).Value)
d1(A & A.Offset(, 3)) = Array(A.Value, A.Offset(, 1).Value, A.Offset(, 3).Value, d(A.Value)(0), d(A.Value)(1))
³oÃ䪺­È¤À§O¬O¹ïÀ³¨â¶ô¸ê®Æªº¤°»ò¶µ¥Ø?
¥t¥~·í§Ú­n¼W¥[¶µ¥Ø®É§Úªº¯x°}¤j¤p©M¶µ¥Ø¼W¥[³]©w¸Ó¦b­þ°µÅܤÆ?
·PÁÂÀ°¦£!

TOP

¦^´_ 5# ivan731129


d(A.Value) = Array(A.Offset(, 1).Value, A.Offset(, 2).Value)'³o¸Ì¬O¤½¥q¸ê®Æ¥H¤½¥q¬°¯Á¤Þ¹ïÀ³ªº¦a§}¸ò°õ¦æ¤H
A.Offset(, 1).Value=¦a§}
A.Offset(, 2).Value=°õ¦æ¤H


d1(A & A.Offset(, 3)) = Array(A.Value, A.Offset(, 1).Value, A.Offset(, 3).Value, d(A.Value)(0), d(A.Value)(1)) '³o¬O¥H¤½¥q¦W¸ò®É¶¡¦X¨Ö¬°¯Á¤Þ¹ïÀ³ªº¤½¥q¡A½s¸¹¡A²£¶q¡A¦a§}¡A°õ¦æ¤H
A.Value=¤½¥q
A.Offset(, 1).Value=½s¸¹
A.Offset(, 3).Value=²£¶q
d(A.Value)(0)=¦a§}
d(A.Value)(1)) =°õ¦æ¤H
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ ivan731129 ©ó 2011-2-22 10:32 ½s¿è

¤W§«ô·PÁ«e½ú¦^À³¡A¦ý¬O«á¨Ó¦b­×§ï®É
¤£ª¾¹D¬O¸ê®Æ¶q°ÝÃDÁÙ¬O³]©w¿ù»~¡A¦A¶]®É·|¥X²{«¬ºA¤£²Å¦X¡C½Ð°Ý¬O­þ¸Ì³]¿ù?
  1. Sub Ex()
  2. Sub Ex()
  3. Dim A As Range
  4. Set d = CreateObject("Scripting.Dictionary")
  5. Set d1 = CreateObject("Scripting.Dictionary")
  6. d1("¾÷ºcºÞ½s") = Array("¾÷ºcºÞ½s", "¾÷ºc¦WºÙ", "¥Ó³ø®É¶¡", "¥Ó³ø­«¶q", "³Ì¤j¤ë²£¥Í¶q", "¥­§¡¤ë²£¥Í¶q", "¨Æ·~¾÷ºc¦a§}", "­t³d¤H©m¦W", "­t³d¤H¾ºÙ", "­t³d¤H¹q¸Ü", "Àô«O³¡ªù¦WºÙ", "Àô«O³¡ªù­t³d¤H", "Àô«O³¡ªù¹q¸Ü", "¼o²M®Ñ¤½§iÃþ§O")
  7. With Sheet2
  8.    For Each A In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp))
  9.      d(A.Value) = Array(A.Offset(, 6).Value, A.Offset(, 12).Value, A.Offset(, 13).Value, A.Offset(, 14).Value, A.Offset(, 15).Value, A.Offset(, 16).Value, A.Offset(, 17).Value, A.Offset(, 31).Value)
  10.    Next
  11. End With
  12. With Sheet1
  13.    For Each A In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp))
  14.    If IsEmpty(d1(A & A.Offset(, 1))) Then
  15.       d1(A & A.Offset(, 1)) = Array(A.Value, A.Offset(, 1).Value, A.Offset(, 8).Value, A.Offset(, 9).Value, A.Offset(, 10).Value, A.Offset(, 11).Value, d(A.Value)(0), d(A.Value)(1), , d(A.Value)(2), d(A.Value)(3), d(A.Value)(4), d(A.Value)(5), d(A.Value)(6), d(A.Value)(7))
  16.      Else
  17.      ar = d1(A & A.Offset(, 1))
  18.      If A.Offset(, 10).Value > ar(10) Then ar(10) = A.Offset(, 10).Value
  19.      d1(A & A.Offset(, 1)) = ar
  20.     End If
  21.    Next
  22. End With
  23. Sheet5.[A1].Resize(d1.Count, 19) = Application.Transpose(Application.Transpose(d1.items))
  24. End Sub
½Æ»s¥N½X

TOP

ªü  ©êºp°ÝÃD§Ú¦Û¤v§ä¨ì¤F!
·PÁ¦U¦ì!!

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¨S¦³©Ò¦³Åv¡A¥u¦³¥Í©Rªº¨Ï¥ÎÅv¡C
ªð¦^¦Cªí ¤W¤@¥DÃD