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

VLOOKUPªº°ÝÃD

VLOOKUPªº°ÝÃD

·Q½Ð°Ý¤@¤U¦p¦ó¦b¨Ï¥ÎVBAªºVLOOKUP¡A¦]¬°´ú¸Õ¤F«Ü¦h¦ý¬O§ìªº­È³£¬O¿ù»~¡A¦ý¤S¤£ª¾¹D­þ¸Ì¿ù»~¡A¦³¨S¦³¤H¥i¥HÀ°§Ú¸ÑÄÀ¤@¤U

µ{¦¡½X¦p¤U¡G

Sub V¦¡§ì­È()

Dim x As Integer
Dim y As String
Dim z As String
1
z = 2
y = Worksheets("Sheet1").Range("A" & z).Value
Range("B2").Value = Application.VLookup(y, Sheet2.[A1:B100], 2)



End Sub



³Â·Ð¤F¡I>"<

Book1.rar (12.15 KB)

¨S¤Uªþ¥ó¡A¤£¹L¬Ý§Aªº¥N½X¡Avlookup¤Ö¤F¤@­Ó°Ñ¼Æ
Application.VLookup(y, Sheet2.[A1:B100], 2,0)

TOP

ºÃ~§Úªþ¥ó¦³¤W¶Ç¦¨¥\°Ú¡I¦b§Úµo¨¥ªº³Ì¤U¤è¡A±z³oÃä¬Ý¤£¨ì¶Ü?
¤£¹L§Ú­è­è¦³­×§ï¤F¤@¤U¡A±N±z»¡ªº°Ñ¼Æ©ñ¶i¥h¡A¦ýÁÙ¬O¨S¿ìªk£z
¦bB2ªº³o®æÁÙ¬OÅã¬O#N/A¡A§Ú¦³¥Î¨ç¼Æ¥h¸Õ¸Õ¬Ý¡A­Y¥X²{#N/A¤£¬O¨S§ì¨ì­È¡A
¦Ó¬O³Ì¶}©lªº¡yy¡z³o­Ó­È¨S¦³§ì¨ìªº·N«ä¡A¦ý¬OÀ³¸Ó¬O¦³§ì¨ì°Ú¡I³o­Ó°ÝÃD§Ú¤@ª½«Ü¯Ç´e~"~

P.S. ¤p§Ì³Ìªñ¤~²Ä¤@¦¸µo©«µo°Ý¡A¨S¸gÅç­Y³y¦¨±zªº¤£«K¯uªº«Ü©êºp¡C

TOP

¤p¾Ç¥Í¨Sªk¤U¸üªþ¥ó,¤£¹L¬Ý¬Ý¬O§_³o¸Ì¥X°ÝÃD¥ý

y = Worksheets("Sheet1").Range("A"& z).Value
My Blog
http://blog.xuite.net/a8350070

TOP

Dim x As Long
Dim y As Long
Dim z As Long

TOP

«¢«¢¡IÁÂÁÂa8350070 À°§Ú´M§ä¿ù»~¡A¤]ÁÂÁÂoobirdªº­@¤ß¸Ñµª¡A°¸¸g¹L´ú¸Õ¯uªº§ì¨ì­È¤F¡I
¶W¶}¤ßªº¡A¦ý¬O¦³­ÓºÃ°Ý¡A·í«Å§i®É¬°¦ó¤£¯à¨Ï¥Îstring¤Ï¦Ó¥Îlong¤~¦æ¡H¨º¦¹¨â­Ó¨Ï¥Îªº¤è¦¡
¬°¦ó?¨ºLong©Ò¥Nªíªº·N«ä¬O¤°»ò©O¡H¯à§_±Ð¾É¤@¤U¡AÁÂÁ¡I
¹ê¦b·PÁÂ¥H¤WÀ°¦£§Ú¸Ñµªªº«e½ú­Ì¡AÁÂÁ¡I

TOP

§A§ây©w¸q¬°String
y=­È´N¬O¦r²Å"100006"¡A¦Ó¬°¬O¼Æ¦r100006
¦bªí¤G¤¤¥u¦³¼Æ¦r10006¡A§ä¤£¨ì"100006"ªº¦r²Å
©Ò¥H¥u¯à¥Î¼Æ¦rÃþ«¬
Long©Ò¥Nªíªº·N«ä¬O¤°»ò©O¡A³Ì¦n¬O§A¦Û¤v§äexcel¤¤ªº»¡©ú¡A¤~·|¦³¦L¶H¡I

TOP

¥»©«³Ì«á¥Ñ sang520 ©ó 2011-6-30 11:26 ½s¿è

§Ú¤S¹J¨ì°ÝÃD¤F¡I¬°¤°»ò§Ú§â¨ä¥LÀɮתº¸ê®Æ½Æ»s¡÷¶K¤W­È¨ìsheet2³o­Ó¬¡­¶
¡Iµ{¦¡½X³£¨SÅÜ¡A¦ý¬O¤S§ì¤£¨ì¤F¡I¬O¤°»ò°ÝÃD°Ú????

Book1(¼W¥[¸ê®Æµ§¼Æ).rar (86.04 KB)

TOP

VLOOKUP¨ç¼Æ¥²¶·ª`·Nªí®æ¤º¸ê®Æ«¬ºA»P·j´M°Ñ¼Æ¸ê®Æ«¬ºA¬O§_¬Û²Å
¤]´N¬O»¡·íªí®æ²Ä¤@Äæ¬O¼Æ­È§AªºVLOOKUP²Ä¤@­Ó°Ñ¼Æ¤]­n¬O¼Æ­È
ªí®æ²Ä¤@Äæ¬O¦r¦ê§AªºVLOOKUP²Ä¤@­Ó°Ñ¼Æ¤]­n¬O¦r¦ê
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

ÁÂÁ¡I±zªº¸Ñµª¤w¸gÅý§Ú§ä¨ìµª®×¤F¡I
¯uªº¬O¨ü¯q¨}¦h¡I

TOP

        ÀR«ä¦Û¦b : ¤H¥Í³Ì¤jªº¦¨´N¬O±q¥¢±Ñ¤¤¯¸°_¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD