Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default find and copy cells

suppose i hav two sheets as follows...
SHEET 1
ID location country

1 211
2 315
3 234
4 146
5 254
6 147
7 631
8 942
9 845
10 413



and sheet 2 as
id name customer location region

1 211 steve ford onsite usa
2 315 alex nissan offshore india
3 631 white gm onsite usa
4 146 rishi tata onshore india
5 254 john ford offshore india
6 147 bill ford offshore india
7 295 george nissan onshore usa
8 942 enayan gm onshore usa
9 845 mike tata offshore usa
10 413 ali gm onsite india
11 456 murray gm onsite usa
12 486 tim tata offshore india
13 546 david tata onsite inida
14 896 micheal nissan onsite usa
15 234 alison nissan onsite france


now i have to search sheet2 and fill up sheet 1 with the corresponding
entries....both the sheets are in the same workbook...
if someone can help me it would be great...

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default find and copy cells

use Vlookup rather than a macro, eg in sheet1, location column:
=vlookup(A1,sheet2!A1:E65000,4,FALSE)

"rishi" wrote:

suppose i hav two sheets as follows...
SHEET 1
ID location country

1 211
2 315
3 234
4 146
5 254
6 147
7 631
8 942
9 845
10 413



and sheet 2 as
id name customer location region

1 211 steve ford onsite usa
2 315 alex nissan offshore india
3 631 white gm onsite usa
4 146 rishi tata onshore india
5 254 john ford offshore india
6 147 bill ford offshore india
7 295 george nissan onshore usa
8 942 enayan gm onshore usa
9 845 mike tata offshore usa
10 413 ali gm onsite india
11 456 murray gm onsite usa
12 486 tim tata offshore india
13 546 david tata onsite inida
14 896 micheal nissan onsite usa
15 234 alison nissan onsite france


now i have to search sheet2 and fill up sheet 1 with the corresponding
entries....both the sheets are in the same workbook...
if someone can help me it would be great...


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default find and copy cells


Hi Rishi,

Try using Excel's VLookup funtion.

See Debra Dalgleish's tutorial at:


Excel -- Worksheet Functions -- VLookup
http://www.contextures.com/xlFunctions02.html


---
Regards,
Norman



"rishi" wrote in message
oups.com...
suppose i hav two sheets as follows...
SHEET 1
ID location country

1 211
2 315
3 234
4 146
5 254
6 147
7 631
8 942
9 845
10 413



and sheet 2 as
id name customer location region

1 211 steve ford onsite usa
2 315 alex nissan offshore india
3 631 white gm onsite usa
4 146 rishi tata onshore india
5 254 john ford offshore india
6 147 bill ford offshore india
7 295 george nissan onshore usa
8 942 enayan gm onshore usa
9 845 mike tata offshore usa
10 413 ali gm onsite india
11 456 murray gm onsite usa
12 486 tim tata offshore india
13 546 david tata onsite inida
14 896 micheal nissan onsite usa
15 234 alison nissan onsite france


now i have to search sheet2 and fill up sheet 1 with the corresponding
entries....both the sheets are in the same workbook...
if someone can help me it would be great...



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default find and copy cells

It's not easy to see exacly how your data are laid out so I've made some
assumptions.

ID on sheet1 is in column A and your data in sheet2 are in columns A to E
and Location is in column 4 and country is in column 5. So try:-

=VLOOKUP(A2,Sheet2!A2:E16,4,FALSE) placed in B2 sheet1 to return loc
=VLOOKUP(A2,Sheet2!A2:E16,5,FALSE) placed in C2 sheet1 to return city

etc

Mike



"rishi" wrote:

suppose i hav two sheets as follows...
SHEET 1
ID location country

1 211
2 315
3 234
4 146
5 254
6 147
7 631
8 942
9 845
10 413



and sheet 2 as
id name customer location region

1 211 steve ford onsite usa
2 315 alex nissan offshore india
3 631 white gm onsite usa
4 146 rishi tata onshore india
5 254 john ford offshore india
6 147 bill ford offshore india
7 295 george nissan onshore usa
8 942 enayan gm onshore usa
9 845 mike tata offshore usa
10 413 ali gm onsite india
11 456 murray gm onsite usa
12 486 tim tata offshore india
13 546 david tata onsite inida
14 896 micheal nissan onsite usa
15 234 alison nissan onsite france


now i have to search sheet2 and fill up sheet 1 with the corresponding
entries....both the sheets are in the same workbook...
if someone can help me it would be great...


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find match between cells and copy data Kcope8302 Excel Worksheet Functions 7 September 18th 09 11:55 PM
Copy contents of Find (Find and Replace) rob_bob Excel Discussion (Misc queries) 0 March 26th 09 11:01 PM
how do we copy all the find cells with their rows in the excel? Siddu Excel Discussion (Misc queries) 1 January 18th 08 09:10 AM
find and copy cells to different workbook ron_dallas Excel Programming 5 September 1st 05 09:14 PM
Search, find, copy muliple cells from new sheet and paste Graham[_5_] Excel Programming 3 December 29th 03 07:38 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"