VBA find string and copy part of row

cazdealer

Board Regular
Joined
Mar 12, 2011
Messages
96
Hi,

I need help with a vba procedure.

I have 2 excel files. DATA.xlsm and RESULTS.xlsm.

in the sheet1 of results.xlsm, I have strings from A1 to A100... C, BAC, GS, MS, SPY, IBM... etc.

in the sheet1 of DATA.xlsm, I have the same kind of strings from A1 to A10000.


I would like to create a vba procedure that will look in all the cells of column A from data.xlsm to find the exact match of the string in A1 from results.xlsm. When it does find the same string, it will copies the row from A to D of data.xlsm into cell M1 of results.xlsm.
then, do the same for A2, A3... etc to A100.

if it doesnt find a matching string, I would like that it copies nothing and continue the loop.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hello

You do not need VBA code here, a usual VLOOKUP function will be enough.

You wrap an IF test around it to see if the string occurs in the DATA sheet.
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,875
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top