ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search and copy macro (https://www.excelbanter.com/excel-programming/334263-search-copy-macro.html)

Frank

Search and copy macro
 
I am having two exel files. I need a macro that looks at the number in file1
cell B2, searches that number in file2 column B and copies a number in that
row (Mx) to cell C2 in file1. It has to do that for the whole column B in
file1.

I found some simmilar tutorials, like this one:
http://cpearson.com/excel/duplicat.htm

but I can't figure out how to do exactlly what I need.

Any help would be great!

Tom Ogilvy

Search and copy macro
 
in C2

=if(C2<"",Vlookup($B2,[File2.xls]Sheet1!$A$1:$F$200,3,False),"")

drag fill down the column.

See Excel help on the vlookup formula.

--
Regards,
Tom Ogilvy



"Frank" wrote in message
...
I am having two exel files. I need a macro that looks at the number in

file1
cell B2, searches that number in file2 column B and copies a number in

that
row (Mx) to cell C2 in file1. It has to do that for the whole column B in
file1.

I found some simmilar tutorials, like this one:
http://cpearson.com/excel/duplicat.htm

but I can't figure out how to do exactlly what I need.

Any help would be great!




Frank

Search and copy macro
 
Thank you! I didn't know about the vlookup and hlookup commands.
It works now exactly as i wanted it!

"Tom Ogilvy" je napisal:

in C2

=if(C2<"",Vlookup($B2,[File2.xls]Sheet1!$A$1:$F$200,3,False),"")

drag fill down the column.

See Excel help on the vlookup formula.

--
Regards,
Tom Ogilvy



"Frank" wrote in message
...
I am having two exel files. I need a macro that looks at the number in

file1
cell B2, searches that number in file2 column B and copies a number in

that
row (Mx) to cell C2 in file1. It has to do that for the whole column B in
file1.

I found some simmilar tutorials, like this one:
http://cpearson.com/excel/duplicat.htm

but I can't figure out how to do exactlly what I need.

Any help would be great!






All times are GMT +1. The time now is 06:48 AM.

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