ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Vlookup (https://www.excelbanter.com/excel-worksheet-functions/101464-vlookup.html)

mtpsuresh

Vlookup
 

Set Rng = lObjInterimWrkSht.Range("$L2:$O1000")
lStrResult = Application.VLookup("1001001", Rng, 4, False)
If Not VBA.IsError(lStrResult) Then
lDblExpensesThisMonthAmt =
VBA.Val(lStrResult)
Else
lDblExpensesThisMonthAmt = 0
End If

It throws error when executing the vlookup function as "Type
Mismatch".

I tried with Application.Worksheetfunction.VLookup and it throws
'Unable to get the VLookup property of the WorksheetFunction class'

Please anyone can help me out.


--
mtpsuresh
------------------------------------------------------------------------
mtpsuresh's Profile: http://www.excelforum.com/member.php...o&userid=31817
View this thread: http://www.excelforum.com/showthread...hreadid=565136


Stefi

Vlookup
 
Try double quotes for string:

lStrResult = Application.VLookup(""1001001"", Rng, 4, False)


Regards,
Stefi

€˛mtpsuresh€¯ ezt Ć*rta:


Set Rng = lObjInterimWrkSht.Range("$L2:$O1000")
lStrResult = Application.VLookup("1001001", Rng, 4, False)
If Not VBA.IsError(lStrResult) Then
lDblExpensesThisMonthAmt =
VBA.Val(lStrResult)
Else
lDblExpensesThisMonthAmt = 0
End If

It throws error when executing the vlookup function as "Type
Mismatch".

I tried with Application.Worksheetfunction.VLookup and it throws
'Unable to get the VLookup property of the WorksheetFunction class'

Please anyone can help me out.


--
mtpsuresh
------------------------------------------------------------------------
mtpsuresh's Profile: http://www.excelforum.com/member.php...o&userid=31817
View this thread: http://www.excelforum.com/showthread...hreadid=565136




All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com