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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting of worksheets in the same Excel workbook

Status
Not open for further replies.

barnard90

IS-IT--Management
Mar 6, 2005
73
US
I have an Excel workbook (WBK), which has two sheets ( Sheet1 and Sheet2 )
Sheet1 has all the countries and their corresponding capitals in column A and Column B respectively. There are about 180 rows

Sheet2 has only few countries ( about 100 ) and has country names and capitals in Column A and Column B respectively

But the country names in Sheet2 are not in the same order as they are in Sheet1. They are in a haphazard manner.

Could some one please suggest me some method or VBA code
by which I can compare the countries in Sheet1 and Sheet2 side by side in Sheet 3


thanks
 
well, why not use a vlookup on your data in sheet1

=VLOOKUP(A2, Sheet2!A:B,2,0)

This will bring the capitol listed on sheet2 next to your data in sheet1 and returns an #N/A if the country is not listed.

Cheers,

Roel
 
This sounds like a homwork question - can you explain the business case behind doing this ?

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
As far as viewing sheets, you can only compare workbooks - not worksheets. If you have them in other workbooks, take a look at Window | Compare side-by-side.

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top