ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Vlookup in VB? (https://www.excelbanter.com/excel-programming/308902-re-vlookup-vbulletin.html)

Don Guillett[_4_]

Vlookup in VB?
 
=VLOOKUP("181006",Inventory!C3:H6,5,FALSE)
try
myrange=sheets("Inventory").range("c3:h6")
range("b3") =VLOOKUP("181006",myrange,5,FALSE)


--
Don Guillett
SalesAid Software

"Alexthecamel" wrote in message
...
I'm writing some code for a simple VB tool, and have come accross a

problem.

I basically need my code to do a vlookup for a number, then return the

cell
reference for the cell in question.

eg: Find the cell in a given range range containing the number 181006,

then
tell me the ref of the cell that is the fifth collumn along.

The vlookup would be:

=VLOOKUP("181006",Inventory!C3:H6,5,FALSE)

If anyone knows, or can point me somewhere i might find the answer i would
really appreciate it, and you never know, my boss might even let me leave
before it gets dark tonight. :-)




Don Guillett[_4_]

Vlookup in VB?
 
I forgot a keyword here.
application.vlookup etc

--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
=VLOOKUP("181006",Inventory!C3:H6,5,FALSE)

try
myrange=sheets("Inventory").range("c3:h6")
range("b3") =VLOOKUP("181006",myrange,5,FALSE)


--
Don Guillett
SalesAid Software

"Alexthecamel" wrote in message
...
I'm writing some code for a simple VB tool, and have come accross a

problem.

I basically need my code to do a vlookup for a number, then return the

cell
reference for the cell in question.

eg: Find the cell in a given range range containing the number 181006,

then
tell me the ref of the cell that is the fifth collumn along.

The vlookup would be:

=VLOOKUP("181006",Inventory!C3:H6,5,FALSE)

If anyone knows, or can point me somewhere i might find the answer i

would
really appreciate it, and you never know, my boss might even let me

leave
before it gets dark tonight. :-)







All times are GMT +1. The time now is 09:42 AM.

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