HOW TO SEARCH IN A COLUMN THAT IS NOT THE FIRST?

G

Guest

I have a document with a table with various column, and i would need to
search a column which is not the first, to return the corresponding value of
the first column. It would be fine to use vlookup if the column I´m searching
were the first. Is there a function which allow me to choose the column to
search? Or does vlookup has the possibility to search in another column but
the 1st?

Thanks in advanmce for any help,
Antonio
 
R

Rick B

Are you using Microsoft Access - the topic of this newsgroup? If not, you
may want to repost to a newsgroup related to the software you are using.
 
G

Guest

It is much faster to use recordsets: Set a reference to DAO

Dim db As DAO.Database
Dim rst As DAO.Recordset

Set db = CurrentDB
Set rst = db.OpenRecordset("Select * From MyTable Where Field3 = 72")

Debug.Print rst!Field1

Slight difference to lookup text values. I use single quote if the are no
apostrophes

"Select * From MyTable Where Field3 = 'Jack'")
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
F

fredg

I have a document with a table with various column, and i would need to
search a column which is not the first, to return the corresponding value of
the first column. It would be fine to use vlookup if the column I´m searching
were the first. Is there a function which allow me to choose the column to
search? Or does vlookup has the possibility to search in another column but
the 1st?

Thanks in advanmce for any help,
Antonio

You have posted this message to the wrong newsgroup.
The access in this groups name refers to Microsoft Access, a database
program.
Please repost to the correct newsgroup for whatever Office program you
are using. I would suggest you include your Windows and Office version
number in the message.
 
G

Guest

Sorry, everyone...
I am on the wrong newsgroup.
my mistake, Antonio

"fredg" escreveu:
 
J

John Vinson

I have a document with a table with various column, and i would need to
search a column which is not the first, to return the corresponding value of
the first column. It would be fine to use vlookup if the column I´m searching
were the first. Is there a function which allow me to choose the column to
search? Or does vlookup has the possibility to search in another column but
the 1st?

Thanks in advanmce for any help,
Antonio

Is this a Document? You mention documents, and vlookup, and columns -
it sounds like you're either using Word or Excel. If you are in fact
using Microsoft Access (the subject of this newsgroup), you can create
a Query based on your table and put criteria on any field (column)
that you wish.

John W. Vinson[MVP]
 

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