VLOOKUP in VBA

B

brett.kaplan

Hi,

I need to do a simple VLOOKUP through visual basic. All I want to do
is set one of my variables equal to the result of a formula that would
normally read:

=VLOOKUP($C6,Codes!$B$C,2,FALSE)

Things I don't want to do:
Use a cell for the formula
Use R[] C[] coding
Define names

Is there any way to do this?

Thanks!

Brett
 
B

Bob Phillips

myVal =
Application.VLOOKUP(Range("C6").Value,Worksheets("Codes").Range("B:C"),2,FAL
SE)


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
B

brett.kaplan

Thank you!

Bob said:
myVal =
Application.VLOOKUP(Range("C6").Value,Worksheets("Codes").Range("B:C"),2,FAL
SE)


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

Hi,

I need to do a simple VLOOKUP through visual basic. All I want to do
is set one of my variables equal to the result of a formula that would
normally read:

=VLOOKUP($C6,Codes!$B$C,2,FALSE)

Things I don't want to do:
Use a cell for the formula
Use R[] C[] coding
Define names

Is there any way to do this?

Thanks!

Brett
 
Top