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

°£¤F¨Ï¥Îon error resume next, ¦p¦ó¤£Åã¥Ü¿ù»~

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-7-3 15:03 ½s¿è

¦^´_ 1# 2# enoch
  1. Option Explicit
  2. Private Sub Worksheet_Change(ByVal Target As Range)
  3.    Dim xlrow  As Integer, xlLook As Variant
  4.     If Target.Column <> 2 Then Exit Sub
  5.     xlrow = Target.Row
  6.     If Cells(xlrow, "A") <> "" Then
  7.          'xlLook = Application.WorksheetFunction.VLookup(Cells(xlrow, "B"), [data], 1, False)
  8.          '¨Ï¥Î¤u§@ªí¨ç¼Æ Application.WorksheetFunction ¦p¶Ç¦^¿ù»~­È ¨t²Î·|¦^À³°õ¦æ¤Wªº¿ù»~¤¤¬qµ{¦¡
  9.          xlLook = Application.VLookup(Cells(xlrow, "B"), [data], 1, False)
  10.         '¦ý¤£¥[¤WWorksheetFunction  ¦p¶Ç¦^¿ù»~­È ¨t²Î¤£·|¦^À³°õ¦æ¤Wªº¿ù»~
  11.         '¦ýÅܼƫ¬ºA »Ý³]¬° Variant
  12.         Cells(xlrow, "D") = IIf(Not IsError(xlLook), xlLook, "§ä¤£¨ì")
  13.     End If
  14. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# enoch
Application.VLookup µ¥¦P Application.WorksheetFunction.VLookup   
®t§O¦b¨ç¼Æ¶Ç¦^¿ù»~­È®É, «eªÌ¤£¥[WorksheetFunction, vba¤£·|²£¥Íµ{¦¡¤Wªº¿ù»~­È

TOP

        ÀR«ä¦Û¦b : ¥Ç¿ù¥XÄb®¬¤ß¡A¤~¯à²M²bµL·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD