开发者

Equivalent of VLookup in VB6

Dear All, I want to use the vlookup function in VB6. what is the code for it? I am currently using this code:

WorkSheetName.Application.VLookup(20,WorkSheetName2.Range("A2:B20").Address,2,Fal开发者_C百科se)

WorkSheetName2 contains the lookup table. WorkSheetName is the sheet that contains a list of values to be looked up for their corresponding values from the lookup. 20 is an example of the value that I want to return its corresponding value from the lookup table. The above code did not work. It returns empty. I also tried the following:

WorkSheetName.Application.WorksheetFunction.Vlookup(20,WorksheetName.Range("A2:B20").Address,2,False)

This gave me an error and can't execute it. Please guide me.


WorkSheetName.Application.WorksheetFunction.Vlookup( _
   20, WorkSheetName2.Range("A2:B20"), 2, False)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜