Search the Text and Copy to File - VBA Code

RShilkar

New Member
Joined
Aug 29, 2018
Messages
2
Hi,

I have excel workbook (file A) where Column D has a list of items and Column C has defined the Sheet Tab Name.
From VBA I need to search each n every item (one by One) in another excel file (file B). if found then That need to copy again to file A on particular tab which is assigned in Column C in (File A).

Means the workflow will be like this -

Will take value from Column D from File A
Will search in another File B Workbook.
If found it will copy to Sheet in File A . sheet Name would be as assigned against that in Column C ( for e.g D3 has value 'ABC' then C3 has Sheet Name as 'Main'. So search text ABC from File B to copy File A under the Sheet Tab 'Main)

If not found - it will print 'Not found' in column E against that D column value.

Could you please help me on this with VBA code.

Thank you.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi,

I have excel workbook (file A) where Column D has a list of items and Column C has defined the Sheet Tab Name.
From VBA I need to search each n every item (one by One) in another excel file (file B). if found then That need to copy again to file A on particular tab which is assigned in Column C in (File A).

Means the workflow will be like this -

Will take value from Column D from File A
Will search in another File B Workbook.
If found it will copy to Sheet in File A . sheet Name would be as assigned against that in Column C ( for e.g D3 has value 'ABC' then C3 has Sheet Name as 'Main'. So search text ABC from File B to copy File A under the Sheet Tab 'Main)

If not found - it will print 'Not found' in column E against that D column value.

Could you please help me on this with VBA code.

Thank you.
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,592
Members
449,089
Latest member
Motoracer88

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