"Vlookup" and "Match" in VBA
- ©«¤l
- 65
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 83
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-4
- ³Ì«áµn¿ý
- 2012-5-21
|
"Vlookup" and "Match" in VBA
§Ú¥±`³£·|¥Î«Ü¦h"Vlookup" ¸ò "Match",¦pªG§Ú·Q¥ÎVBAªº¤è¦¡¼g¥X¨Ó,¸Ó«ç»ò°µ©O? |
|
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|
- ©«¤l
- 1572
- ¥DÃD
- 16
- ºëµØ
- 2
- ¿n¤À
- 1521
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2016-1-13
|
|
|
|
|
|
|
- ©«¤l
- 65
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 83
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-4
- ³Ì«áµn¿ý
- 2012-5-21
|
ÁÂÁ¦^ÂÐ,¥i±¤§ÚÅv¤£°÷,¤£¯à¤U¸ü,¥i¥H²³æªº¤¶²Ð¤@¤U¶Ü? |
|
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|
- ©«¤l
- 1572
- ¥DÃD
- 16
- ºëµØ
- 2
- ¿n¤À
- 1521
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2016-1-13
|
¤èªk1¡G¥Îapplication.¤Þ¥Î¤½¦¡
¤èªk2.¥Îevaluate+¤½¦¡
¤èªk3.¥Î¤¤¨í¸¹§â¤½¦¡®Ø°_¨Ó |
|
|
|
|
|
|
- ©«¤l
- 65
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 83
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-4
- ³Ì«áµn¿ý
- 2012-5-21
|
ÁÂÁÂ,§Ú¸Õ¤F...
x = Range("D" & z).Application.Formula = " [=MATCH(Sheets1!""ItemName"",Sheets2!A:A,0)]"
´N¬O¤£¦æ,¥i¥H§i¶D§Ú,§Ú¿ù¦bþ¸Ì¶Ü?
ÁÂÁÂ~~! |
|
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|
- ©«¤l
- 1572
- ¥DÃD
- 16
- ºëµØ
- 2
- ¿n¤À
- 1521
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2016-1-13
|
Range("d" & z) = Evaluate("MATCH(""ItemNam"",Sheet2!A:A,0)") |
|
|
|
|
|
|
- ©«¤l
- 1572
- ¥DÃD
- 16
- ºëµØ
- 2
- ¿n¤À
- 1521
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2016-1-13
|
¤Wz¦C¥Xªº¤èªk§A¥u¯à¿ï¤@¼Ë
¤£¯à¨C¼Ë¦P®É¥Î¡AÁÙ¥[¤W¿ý»sªº¥N½X
«e±"x="¤]¤£¯à¥[¦b¸Ì±¡Aþ¯à³o»ò¦hµ¥¸¹¡H |
|
|
|
|
|
|
- ©«¤l
- 65
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 83
- ÂI¦W
- 0
- §@·~¨t²Î
- Window 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2010-5-4
- ³Ì«áµn¿ý
- 2012-5-21
|
¥»©«³Ì«á¥Ñ am0251 ©ó 2011-6-22 17:13 ½s¿è
«Ü©_©Ç,§Ú¸Õ¹L:
ItemNam = Range("A" & z).Value
x = Application.WorksheetFunction.Match(""ItemNam"",, Sheets("OUT").Range("A:A"))
¬O¤£¦æªº,¥u¦³¤£¥ÎÅܼÆ"ItemNam"¦Óª½±µ§â"Range("A" & z).Value"¥´¶i¥h¤~¯à¥Î
Book1.rar (12.98 KB)
|
|
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X
|
|
|
|
|
- ©«¤l
- 1572
- ¥DÃD
- 16
- ºëµØ
- 2
- ¿n¤À
- 1521
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2016-1-13
|
ÅܼƦ³Åܼƪº¥Îªk¡A¸ò¦r²Å¬O¤£¦Pªºªí¥Ü¡C
ÅܼƤ£¥ÎÂù¤Þ¸¹¡C |
|
|
|
|
|
|
- ©«¤l
- 1572
- ¥DÃD
- 16
- ºëµØ
- 2
- ¿n¤À
- 1521
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2016-1-13
|
¶â¡A¤W¶ÇÀÉ®×´N¦n¿ì¤F¡I
§ï³o¼Ë- Sub test()
- Dim x As Integer
- Dim y As Integer
- Dim z As Integer
- Dim ItemName As String
- z = 2
- Do While Range("A" & z).Value <> ""
- ItemNam = Worksheets("Sheet1").Range("A" & z).Value
- x = Application.Match(ItemNam, Sheet2.[A1:A100], 0)
- Debug.Print x
- z = z + 1
- Loop
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|