使用VBA达到vlookup效果

2020-09-17 10:13:41 浏览数 (1)

代码语言:javascript复制
Function Desc(ProdNum)

Desc = Application.WorksheetFunction.VLookup(ProdNum, Range("myTable"), 2, 0)

End Function

Function DAdded(ProdNum)

DAdded = Application.WorksheetFunction.VLookup(ProdNum, Range("myTable"), 3, 0)

End Function

Function Status(ProdNum)

Status = Application.WorksheetFunction.VLookup(ProdNum, Range("myTable"), 4, 0)

End Function

效果如下

0 人点赞