如何在VBA中应用Excel的函数,如vlookup()?

2024-12-17 07:15:49
推荐回答(2个)
回答1:

Application.WorksheetFunction.VLookup()

括号里头该怎么写还怎么写
比如
Cells(r, 5) = Application.WorksheetFunction.VLookup(Cells(r, 1), Range("B1:D100"), 2, 0)

回答2:

=IF(ISERROR(VLOOKUP(C1,A:B,2,0)),"",VLOOKUP(C1,A:B,2,0))