vb 6.0 --> In vb code, VLookup using Application.WorksheetFunction.VLookup() returning 82.00 instead of 82.327, 75.00 instead of 75.728 .. etc..
Posted on 2008-10-26
In vb 6, I'm doing a VLookup which references an excel range... using Application.WorksheetFunction.VLookup(parmInvestName, rngFind, 1, False) , but it keeps returning the whole # without the decimal.. but i need the decimal.
This is urgent question as I'm not very familiar with vb syntax.. i've tried changing from Double to Long and everything else, but it still doesn't return the decimal places for a double type.. here is example of one of my attempts :
Public Function FindPutDeltaRefSecond(parmInvestName As String) As Long
Dim rngFind As Range
Set rngFind = RefData.Option.TablePutData
On Error GoTo Terminate
FindPutDeltaRefSecond = CLng(Application.WorksheetFunction.VLookup(parmInvestName, rngFind, 3, False))
Set rngFind = Nothing