ªð¦^¦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¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD