Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup in Excel

Status
Not open for further replies.

graemematthew

Technical User
Jun 10, 2002
6
GB
I need a formula/macro that will check the contents of a cell in sheet 1 then check for an occurance of this contents in column A in sheet 2 and copy the contents in sheet 2 coulmn B for the relevant row number where the match was found.

Any ideas anyone?
 
Hi,

You can do this with a spreadsheet lookup function or with VBA.

Here's the lookup approch...
Code:
=VLOOKUP($A2,Sheet2!$a$2:$z$9999,B$1,False)
where
column A has the lookup values
row 1 has the relative column number where the values to be "copied" resides
sheet2 A2:Z9999 is the lookup table

copy the formula across and down and VOLA!

Hope this helps :)

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top