在excel vba中编写vlookup函数

时间:2017-04-13 22:18:24

标签: excel vba

我正在尝试使用excel VBA编写vlookup,我有我的代码(如下所示),它运行时没有错误,但它没有做任何事情......

这是我的excel常规代码:= VLOOKUP(A2,vend!$ A $ 1:$ O $ 60802,6,0)

这是我的vba代码:

Sub vlookup()


  Dim result As String
Dim sheet As Worksheet
Set sheet = ActiveWorkbook.Sheets("vend")
result = Application.WorksheetFunction.vlookup(sheet.Range("A2"), sheet.Range("A1:O60802"), 6, False)


End Sub

0 个答案:

没有答案