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

[µo°Ý] VLookup Vba¥Îªk

¥»©«³Ì«á¥Ñ ziv976688 ©ó 2021-10-3 00:53 ½s¿è

¦^´_ 8# samwang
°Ñ¦Ò   http://forum.twbts.com/thread-23380-1-1.html   8#ªº¶Q¸Ñ~
±NIf Arr(i, j) = 0 Then n = n + 1: Arr(1, j) = n Else Arr(1, j) = "V": GoTo 100]    '¦C167
§ï¬°
    If Arr(i, j) = 0 Then n = n + 1    '¦C167
    If n > 0 Then Arr(1, j) = n Else Arr(1, j) = "V": GoTo 100    '¦C168
¶]¥X¨Óªºµª®×¬O¥¿½Tªº¡C
¦ý¤£ª¾¹D³o¼Ë§ï¹ï¤£¹ï ? (¨S¦³¦Û«H)

¥H¤W  Àµ½Ð½ç¥¿
ÁÂÁ±z

TOP

¦^´_ 11# ziv976688

¥u­n¦³¹Á¸Õ¼g¡A´N·|¦³¶i¨B¡A­×§ï¦p¤U¡A½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
        If Arr(i, j) = 0 Then
            n = n + 1: Arr(1, j) = n
        ElseIf Arr(i, j) > 0 And n = 0 Then
           Arr(1, j) = "V"
        End If

TOP

¦^´_ 12# samwang
OK¤F
ÁÂÁ±zªº­@¤ß«ü¾É©M¼ö¤ßÀ°¦£~¨ü¯q¨}¦h~·P®¦

TOP

¥»©«³Ì«á¥Ñ ziv976688 ©ó 2021-10-4 07:11 ½s¿è

¦^´_ 12# samwang
TEST_1004.rar (325.22 KB)
¤£¦n·N«ä¡A³Ì«á2­Ó°ÝÃD~³Ò¾r±z½ç¥¿~ÁÂÁ±z

°ÝÃD1¡G
7T_·j´M(²Î)¦rÀÉ(¥DÀÉ)_1003(C2_C26=VBA)°õ¦æ«áªº®ÄªGÀÉ~
²Î­p"0"ªº­Ó¼Æ~¦bC26³£·|©T©w¦h1­Ó(¥H7T_·j´M(²Î)¦rÀÉ(¥DÀÉ)_0930(C2_C26=fx)ªº®ÄªGÀɤñ¹ï)~
½Ð¸Ô¨£¡G7T«e3¤j&¤p_0_1902´Á_100_7­Ó_1¦¸(C26=VBA®ÄªGÀÉ)¡F7T«e3¤j&¤p_0_1902´Á_100_14­Ó_1¦¸(C26=VBA®ÄªGÀÉ)
PS¡G¦pªG±z­n´ú¸Õ14­ÓÀɮתº¸Ü~½Ð±N¥t7­Ó7RA²ÎªºÀɮסA¸m¤J¤l¸ê®Æ§¨¤º«á~¦A°õ¦æ(¥DÀÉ)§Y¥i¡C

°ÝÃD2¡G
7T_·j´M(²Î)¦rÀÉ(¥DÀÉ)_1003(C2_C26=VBA)ªº¦C191~¦C197µ{¦¡½X¤£¯à°õ¦æ~
¦pªG°õ¦æ~·|¦b¦C195¦Û°ÊÄæ¼e²£¥Í"°»¿ù"~µM«áµLªkÃö³¬ÀÉ®×~·|·í¾÷~¥²¶·±j¨î­«·s¶}¾÷

³Æµù¡G
¦pªG±N7T_·j´M(²Î)¦rÀÉ(¥DÀÉ)_1003(C2_C26=VBA)ªº
¦C3§ï¬°
Dim Path As String, A, Ar(1 To 1000, 1 To 2), Arr, Brr(1 To 7), Crr, T, i&, j& ', n%, ci%, cj%, ai%
¦C142~¦C145§ï¬°°õ¦æ
¦C147~¦C176§ï¬°µù¸Ñ
¦C191~¦C197§ï¬°°õ¦æ
§Y=7T_·j´M(²Î)¦rÀÉ(¥DÀÉ)_0930(C2_C26=fx)¡A
«h¦C191~¦C197ªºµ{¦¡½X´N¥i¥H°õ¦æ¡C

¥H¤W   Àµ½Ð½ç±Ð¡CÁÂÁ±z    

TOP

¦^´_ 14# ziv976688


°ÝÃD1: >> ¤w§ó·s¡A¦pªþ¥ó¡A½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁ¡C

°ÝÃD2¡G
7T_·j´M(²Î)¦rÀÉ(¥DÀÉ)_1003(C2_C26=VBA)ªº¦C191~¦C197µ{¦¡½X¤£¯à°õ¦æ~
¦pªG°õ¦æ~·|¦b¦C195¦Û°ÊÄæ¼e²£¥Í"°»¿ù"~µM«áµLªkÃö³¬ÀÉ®×~·|·í¾÷~¥²¶·±j¨î­«·s¶}¾÷
>> °ÝÃD2¡A§Ú´ú¸Õ¨S°ÝÃD¡A¥t¥~¦C191~197(ª©­±³]©w)¡A«á¾Ç»{¬°¬O¦h¾lªº¥i¥H²¾°£¡A
¦]¬°«á­±µ{¦¡¦C200 ¬O±N¾ã­Ó­ì¨ÓÀɮ׮榡¾ã­Ócopy ¡AµM«á¥t¦s·sÀÉ¡A©Ò¥H¤£¥Î¦A¨C¦¸­«·s³]©w¡A
²M°£Â¸ê®Æ®É¡A»Ý¥Î.ClearContents¡A¤£¥i¥Î.Delete(­ì®æ¦¡³]©w²M°£)¡AÁÂÁÂ

7T_·j´M(²Î)¦rÀÉ(¥DÀÉ)_1004(C2_C26=VBA).zip (53.27 KB)

TOP

¥»©«³Ì«á¥Ñ ziv976688 ©ó 2021-10-4 09:46 ½s¿è

¦^´_ 15# samwang
´ú¸Õµ²ªG :
°ÝÃD1 :
¦C147 §ï¬°    Crr = .Range("c2:ay16"): Arr = .Range("c47:ay" & R): n = 0
°ÝÃD¤w¸Ñ¨M

°ÝÃD2 :
¦]¬°²Ó¬d«á~µo²{BUG¥X¦b  .Font.Name = "Verdana" '¦rÅé¡F
¦Ó§Ú©Ò»Ý­nªº¬O .EntireColumn.AutoFit  '¦Û°ÊÄæ¼e (Sheets("Sheet1")¹w¥ý³]©wªº"¦Û°ÊÄæ¼e"~µL®Ä~¦]¬°¨C´ÁªºÄæ¼e¬O¯B°Ê¤£©wªº)

¦p¶Q«Øij~±N .Font.Name = "Verdana" '¦rÅé²¾°£
°ÝÃD¤w¸Ñ¨M

ÁÂÁ±zªº­@¤ß«ü¾É©M¼ö¤ßÀ°¦£~¨ü¯q¨}¦h~·P®¦

TOP

        ÀR«ä¦Û¦b : ¡i¦æµ½­n¤Î®É¡j¦æµ½­n¤Î®É¡A¥\¼w­n«ùÄò¡C¦p¿N¶}¤ô¤@¯ë¡A¥¼¿N¶}¤§«e¤d¸U¤£­n°±º¶¤õ­Ô¡A§_«h­«¨Ó´N¤Ó¶O¨Æ¤F¡C
ªð¦^¦Cªí ¤W¤@¥DÃD