ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VLOOKUP in VBA (https://www.excelbanter.com/excel-discussion-misc-queries/107951-vlookup-vba.html)

[email protected]

VLOOKUP in VBA
 
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


Bob Phillips

VLOOKUP in VBA
 
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)

wrote in message
ups.com...
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




[email protected]

VLOOKUP in VBA
 
Thank you!

Bob Phillips wrote:
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)

wrote in message
ups.com...
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




All times are GMT +1. The time now is 07:17 PM.

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