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

[µo°Ý] VBA ¤¤¤Þ¥Î Mach ¨ç¼Æ°ÝÃD

[µo°Ý] VBA ¤¤¤Þ¥Î Mach ¨ç¼Æ°ÝÃD

¥»©«³Ì«á¥Ñ hsu5120 ©ó 2016-5-1 07:35 ½s¿è

½Ð°Ý¦U¦ì¤j¤j¡G
³o¤@¬qµ{¦¡¤¤¡AXX °Ñ¼Æ­n¦p¦ó§ï¼g¡A¤~¯à¥¿½T¶]¥X­È¡H

2016-05-01 07 22 36.jpg (102.72 KB)

2016-05-01 07 22 36.jpg

VBA¥N¤JMACH¨ç¼Æ°Ñ¼Æ.rar (32.74 KB)

Range("N2") = "=MATCH(""" & arr_str_check(i) & """," & xx & ",0)"

TOP

¦^´_ 1# hsu5120
  1.     i = 5
  2.     ii = Range("U2").End(xlDown).Row
  3.     xx = "U3:U19"

  4.     s = WorksheetFunction.Match(arr_str_check(i), [A10:I10], 0)
  5.     [A12] = Cells(10, s)
  6.     s = WorksheetFunction.Match(arr_str_check(i), arr_str_check, 0) - 1
  7.     MsgBox "arr_str_check(i) = " & arr_str_check(i) & vbCrLf & "arr_str_check(s) = " & arr_str_check(s)
  8. End Sub
½Æ»s¥N½X

E1.png (35.54 KB)

E1.png

TOP

ÁÂÁ¦U¦ì¤j¤j¼ö¤ßªº¦^ÂСA¨ä¹ê·Q­n±N
1.³o¤@¦æ    xx="U3:U19"  ¡A§ï¦¨  xx="U3:U" & ii (ii ¬°ÅܼÆ)¡C
2.µM«á ±N ³o¤G¦æµ{¦¡¡G
    xx="U3:U" & ii
   Range("N4") = "=MATCH(""" & arr_str_check(i) & """, " & xx & ",0)"

3.¦X¨Ö¦¨ ¤@¦æµ{¦¡(¦p¤U)¡G
Range("N6") = "=MATCH(""" & arr_str_check(i) & """, ""U3:U""" & ii & """,0)"     '³o¤@¦æ¤@ª½¦³°ÝÃD

½Ð°Ý¤j¤j³o¤@¦æ¦p¦ó­×§ï¡A¥ýÁÂÁ¤j¤j ¼ö¤ßªº¦^ÂСC

TOP

Range("N2") = "=MATCH(""" & arr_str_check(i) & """," & xx & ",0)"
­ã´£³¡ªL µoªí©ó 2016-5-1 10:20

³o¨à±a¤Jªº xx ¬O¦r¦ê«¬ºA¡A¨ç¦¡ªº MATCH() ³ºµM¯à±µ¨ü¡A
¤Ï¤§¦pªG±a¤J WorksheetFunction.Match() «K¤£¦æ¤F¡A

WorksheetFunction.Match(arr_str_check(i), xx, 0)

°õ¦æ¶¥¬q¿ù»~ '1004'
µLªk¨ú±oÃþ§O WorksheetFunction ªº Match ÄÝ©Ê
¦Ó¥²¶·«Å§i¦¨ Range/Object ¤~¥i¥H¡C

Set xx = [U3:U19]
WorksheetFunction.Match(arr_str_check(i), xx, 0)

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-5-1 11:40 ½s¿è
ÁÂÁ¦U¦ì¤j¤j¼ö¤ßªº¦^ÂСA¨ä¹ê·Q­n±N
1.³o¤@¦æ    xx="U3:U19"  ¡A§ï¦¨  xx="U3:U" & ii (ii ¬°ÅܼÆ)¡C
2 ...
hsu5120 µoªí©ó 2016-5-1 11:12

xx = "U3:U"
ii = 19
Range("A8") = "=MATCH(""" & arr_str_check(i) & """," & xx & ii & ",0)"
¤W¤U¨â¦æ§¡¬°¥¿½T»yªk¡C
Range("A8") = "=MATCH(""" & arr_str_check(i) & """,U3:U" & ii & ",0)"

TOP

¦^´_ 5# c_c_lai


WorksheetFunction.Match(arr_str_check(i), xx, 0)
§ï¥Î¡G
M = WorksheetFunction.Match(arr_str_check(i), Range(xx), 0)
M = Application.Match(arr_str_check(i), Range(xx), 0)

TOP

¦^´_ 7# ­ã´£³¡ªL
Tks a lot!

TOP

        ÀR«ä¦Û¦b : ¦³¦h¤Ö¤O¶q´N°µ¦h¤Ö¨Æ¡A¤£­n¤ß¦sµ¥«Ý¡Aµ¥«Ý¤~·|¸¨ªÅ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD