Vlookup problem - unable to get the vlookup property

F

Fred

Hi
I've been reading posts and trying all kinds of things with no luck.

Dim Char23PayorName as String
Dim SumRW as Integer 'using the current row

Char23PayorName = Application.VLookup(Range("A" _
& SumRW).Value, "Payor_Payee!A2:D10000", 4, False)

I think the problem is in that the value returned for the lookup value is
text and not a number. When debugging, it is showing the lookup value as
"Nameabc". The result of this formula will be text.

I have restructrued the code to put a formula in a cell. However, the
#NAME? error is returned from the formula. The formula in that cell reads:
=vlookup(Nameabc, Payor_Payee!A2:D10000, 4, False). If I put quotation marks
around the vlookup value in the formula "Nameabc", then it works.

Please help while I still remain somewhat sane. Thanks
Fred
 
M

Mike H

Hi,

Try this

Char23PayorName = Application.VLookup(Range("A" & SumRW).Value, _
Range("Payor_Payee!A2:D10000"), 4, False)

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top