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

[µo°Ý] ½Ð°ÝVB¦p¦ó¨Ï¥Îexcelªºvlookup¤½¦¡©O?

[µo°Ý] ½Ð°ÝVB¦p¦ó¨Ï¥Îexcelªºvlookup¤½¦¡©O?



§Ú·Q¦b²Ä¤@®æªºmya.Text¸Ì¿é¤J,°Ó«~ªº°ê»Ú±ø½X

µM«áÅý²Ä¤G®æªºmyb.Caption¸Ì§Q¥ÎVlookup¥h§ì¨ú¸ê®Æ¦^¶ÇÅã¥Ü

¬¡­¶Ã¯¦WºÙ¬O"Á`«~¶µ"

­ì¥»¼g¦bexcel¸Ìªº¤½¦¡¬O  =VLOOKUP(D10,Á`«~¶µ!A:D,2,FALSE))

·Q§ï¥Îªí³æªº¤è¦¡¥h¥[¤J§e²{

¤£ª¾¬O§_¦³¤H¯à¨ó§U§Ú¥[¤J³o¬q©O?

³Â·Ð¤F,ÁÂÁÂ

Application.worksheetfunction.vlookup(                   )  <-- ¤@¼Ë¤è¦¡¨Ï¥Î
VBA¤¤¨Ï¥ÎExcelªº¨ç¦¡¡C
https://docs.microsoft.com/zh-tw/office/vba/api/excel.worksheetfunction.vlookup
­É¿ú¤£ÁÙ¡A¤~¬O¤ý¹D

TOP

¦^´_ 1# PIPI
  1. Private Sub mya_Exit(ByVal Cancel As MSForms.ReturnBoolean)
  2. Dim rn As Range
  3. For Each rn In Sheets("sheet1").Range("A2:A1000" & Sheets("Á`«~¶µ").Cells(Rows.Count, "A").End(xlUp).Row)
  4.    If mya.Text = rn Then
  5.         myb.Value = Sheets("Á`«~¶µ").Cells(rn.Row, "B")
  6.         Exit For
  7.        ' MsgBox ("§¹¦¨")
  8.     Else
  9.         myb.Value = "¬dµL¦¹¸ê®Æ"
  10.     End If
  11. Next
  12. End Sub
½Æ»s¥N½X
¦bmya¿é¤J§¹°ê»Ú½X¦Û°Ê¿é¤Jmyb¶µ¥Ø

TOP

        ÀR«ä¦Û¦b : ¡i°µ¤Hªº¶}©l¡j¨C¤@¤Ñ³£¬O¬G¤Hªº¶}©l¡A¨C¤@­Ó®É¨è³£¬O¦Û¤vªºÄµ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD