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

¦p¦ó§PÂ_¬°¦P¤@²Õ(¶i¶¥°ÝÃD¡^

½Ð°Ýª©¥D:¥Îvlookup¤@©w­n±Æ§Ç,­Y­n¤u§@ªíacc ¤¤aÄæ­n¥[¤J±Æ§Ç¥\¯à¸Ó¦p¦ó¼g?
§Æ±æ¤ä«ù!

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2018-8-14 20:23 ½s¿è

¦^´_ 11# s7659109


VLOOKUP¤£¥Î±Æ§Ç
­ì¤½¦¡·|»Ý­n±Æ§Ç, ¬O¬Ù¤F²Ä¥|­Ó°Ñ¼Æ(TRUE/FALSE)
VLOOKUP(§ä¬d­È, °Ï°ì, Äæ¦ì, TRUE/FALSE)  ¥ÎFALSE´N¤£¶·±Æ§Ç(ºë½T¤ñ¹ï)

VLOOKUP(C2,accnum,2,FALSE)
VLOOKUP(C2,accnum,2,0)
VLOOKUP(C2,accnum,2,)
¤T­Ó¤½¦¡¹D²z¬Û¦P

TOP

If TC = "" Then xD(T) = "|" & Arr(i, 4): GoTo 101
    If TC <> "|" & Arr(i, 4) Then xD(T) = "²§±`"
³o¤@¬q¤£¤ÓÀ´,¥i§_»¡©ú
§Æ±æ¤ä«ù!

TOP

ÁÂÁ¦ý¤U­±¨º¥y,¥i§_»¡©ú,¦h¾Ç¤@ÂI
§Æ±æ¤ä«ù!

TOP

¦^´_ 13# s7659109

TC = xD(T)  
>> ¨ú¦r¨åÀɪº ITEM ­Èµ¹ TC

If TC = "" Then xD(T) = "|" & Arr(i, 4): GoTo 101  
>> ¦pªGTC¬OªÅ­È, ªí¥Ü©|¥¼±a¤JxD, «hµ¹¤©DÄ檺­È¬°ITEM,
    DÄæ¤å¦r«e¥["|", ¬O¦Ò¼{DÄæ¥i¯à¬OªÅ¥Õªº,  ´N·|»P IF TC = "" ¤S²£¥Í´`Àô

If TC <> "|" & Arr(i, 4) Then xD(T) = "²§±`"
>> ¤ñ¸û TC »P ·í«e¦CDÄæ¤å¦r, ­Y¤£¬Û¦P, §Y¬O²§±`

TOP

ÁÂÁª©¥D¡A¤Sªø¶i¤F
§Æ±æ¤ä«ù!

TOP

±µÄò°ÝÃD:·ísoure¦³§ó·s¸ê®Æ,¤u§@ªí1·|¦Û°Ê¸ü¤J·s¸ê®Æ¶i¨Ó
        ·í¦¸¤ë¨t²Î¤é´Á15¤é®É,¤W­Ó¤ë¿ì²z¹L±b(¨C­Ó¤ë)¤£±o§ó°Ê¤F[attach]29223[/attach]

1070815.zip (22.55 KB)

§Æ±æ¤ä«ù!

TOP

¦^´_ 8# ­ã´£³¡ªL


    ÁÂÁ½׾Â,ÁÂÁ«e½ú
«á¾ÇÂǦ¹©«¾Ç²ß«e½úªº¤è®×,¤è®×¾Ç²ß¤ß±oµù¸Ñ¦p¤U,½Ð«e½ú¦b«ü¾É

°õ¦æ«e:


°õ¦æµ²ªG:



Option Explicit
Sub NumberCode()
Dim Arr, i&, xD, T$, TC$
'¡ô«Å§iÅܼÆ
Set xD = CreateObject("Scripting.Dictionary")
'¡ô¥OxDÅܼƬO¦r¨å
Arr = Range([D2], [A65536].End(3))
'¡ô¥OArrÅܼƬO ¤Gºû°}¦C,¥HA~DÄæ²Ä2¦C¥H¤UÀx¦s®æ­È±a¤J°}¦C¤¤
For i = 1 To UBound(Arr)
'¡ô³]¶¶°j°é!
    T = Arr(i, 1) & Arr(i, 2):  TC = xD(T)
    '¡ô¥OTÅܼƬO ²Ä1Äæ»P²Ä2Äæ°}¦C­È©Ò²Õ¦¨ªº·s¦r¦ê,
    '¥OTCÅܼƬO ¥HTÅܼƬdxD¦r¨å¦^¶Çitem­È

    If TC = "" Then xD(T) = "|" & Arr(i, 4): GoTo 101
    '¡ô¦pªGTCÅܼƬOªÅªº!´N¥OTÅܼƷíkey,item¬O"|"¦r¤¸³s±µ²Ä4Äæ°}¦C­È,
    '©Ò²Õ¦¨ªº·s¦r¦ê,µM«á´N¸õ¨ì101¼Ð¥Ü¦ì¸mÄ~Äò°õ¦æ

    If TC <> "|" & Arr(i, 4) Then xD(T) = "²§±`"
    '¡ô¦pªGTCÅܼƭȤ£¦P©ó "|"³s±µ²Ä4ÄæArr°}¦C­È?
    '´N¥OTÅܼƦbxD¦r¨å¸Ìªºitem­È´«¬° "²§±`"¦r¦ê

101: Next i
For i = 1 To UBound(Arr)
'¡ô³]¶¶°j°é!
    T = Arr(i, 1) & Arr(i, 2): Arr(i, 1) = ""
    '¡ô¥OTÅܼƬO ²Ä1Äæ»P²Ä2Äæ°}¦C­È©Ò²Õ¦¨ªº·s¦r¦ê,
    '²M°£±¼Arr°}¦C²Ä1Ä檺­È

    If xD(T) = "²§±`" Then Arr(i, 1) = "x"
    '¡ô¦pªG¥HTÅܼƬdxD¦r¨å¦^¶Çitem­È¬O "²§±`",
    '´N¥O·í¦CArr°}¦C²Ä1Ä檺­È¬O "x"

Next i
[G2].Resize(UBound(Arr)) = Arr
'¡ô¥OArr°}¦C­È±q[G2]Àx¦s®æ¶}©l¼g¤J,¶W¹L¦¹½d³òªº°}¦C­È©¿²¤
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß°}¦C»y¦r¨å,¾Ç²ß¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð

Option Explicit
Sub TEST()
Dim Brr, Y, i&, T$, T4$
'¡ô«Å§iÅܼÆ
Set Y = CreateObject("Scripting.Dictionary")
'¡ô¥OYÅܼƬO ¦r¨å
Brr = Range([D2], Cells(Rows.Count, 1).End(xlUp))
'¡ô¥OBrrÅܼƬO ¤Gºû°}¦C,¥HA~DÄæ²Ä2¦C¥H¤UÀx¦s®æ­È±a¤J°}¦C¤¤
For i = 1 To UBound(Brr)
'¡ô³]¶¶°j°é
   T = Brr(i, 1) & Brr(i, 2): T4 = Brr(i, 4) & "|"
   '¡ô¥OTÅܼƬO ²Ä1Äæ»P²Ä2Äæ°}¦C­È©Ò²Õ¦¨ªº·s¦r¦ê,
   '¥OT4ÅܼƬO ²Ä4Äæ°}¦C­È³s±µ "|"²Å¸¹©Ò²Õ¦¨ªº·s¦r¦ê

   If Y(T) <> T4 And Y(T) <> "" Then Y(T & "|") = "X" Else Y(T) = T4
   '¡ô¦pªGTÅܼƬdY¦r¨å±oitem­È»P T4ÅܼƤ£¦P,¦Ó¥B
   '¥BTÅܼƬdY¦r¨å±oitem­È¤£¬Oªì©l­È!´N¥OTÅܼƳs±µ"|"²Õ¦¨ªº·s¦r¦ê·íkey,
   'item¬O"X",¯Ç¤JY¦r¨å¤¤,
   '§_«h´N¥OTÅܼƷíkey,item¬OT4ÅܼƯǤJY¦r¨å¤¤

Next
For i = 1 To UBound(Brr)
'¡ô³]¶¶°j°é
   Brr(i, 1) = Y(Brr(i, 1) & Brr(i, 2) & "|")
   '¡ô¥OBrr°}¦C²Ä1Äæ¼g¤J ²Ä1Äæ»P²Ä2Äæ°}¦C­È³s±µ"|"²Õ¦¨ªº·s¦r¦ê,
   '¬dY¦r¨å¦^¶Çitem­È

Next
[G2].Resize(UBound(Brr)) = Brr
'¡ô¥O±q[G2]Àx¦s®æ¶}©l¼g¤JBrr°}¦C­È,¶W¹L¦¹½d³òªº°}¦C­È©¿²¤
Set Y = Nothing: Erase Brr
'¡ô¥OÄÀ©ñÅܼÆ
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

H2=REPT("X",COUNTIFS(A:A,A2,B:B,B2,D:D,D2)<>COUNTIFS(A:A,A2,B:B,B2))
google"EXCEL°g"  blog  ©Îgoogleºô§}:https://hcm19522.blogspot.com/

TOP

        ÀR«ä¦Û¦b : ¬O«D·í±Ð¨|¡AÆg¬ü§@ĵ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD