Find word/s in a cell or column and paste the value to another cell.

ac0510

New Member
Joined
Oct 24, 2018
Messages
1
Hi experts! I'm posting this thread hoping for an answer to my not-so-complicated requirement in excel. I was browsing through the web and came across MrExcel and found most of the relevant threads from here.

I need a macro/VBA in excel where I can find and extract word/s from a cell or column and paste them to another cell whether in the same sheet or another.

Here's a sample scenario.

Sentences splitted into many line breaks will be pasted to Column A, so here's what is going to look like.
Column AColumn BColumn C
1This is a sample message.
2John Smith
3AB 123 CDE FGH
4AB Apple
5CDE Dog
6FGH Cat

<tbody>
</tbody>










I need to paste the words to Column C to arrange them properly with Column B as the corresponding field names.
Column AColumn BColumn C
1This is a sample message.Name:John Smith
2John SmithBlood:AB
3AB 34 CDE FGHAge:34
4AB AppleFruit:Apple
5CDE DogPet1:Dog
6FGH CatPet2:Cat

<tbody>
</tbody>










In the above table, we assumed that the 2nd row is the Name, while the 3rd is the blood type followed by the age.

I would also appreciate if you can guide me in creating macro statements like in the table above, the CDE (which means Dog in the example) is present in Column A, therefor, Pet1 is generated as Dog instead of CDE. Same goes with the FGH/Cat.

Guys, I really hope you could help me with this macro. I would greatly ease up our daily process of segregating data in Excel.

Thank you in advance!
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Watch MrExcel Video

Forum statistics

Threads
1,127,601
Messages
5,625,749
Members
416,133
Latest member
ToseSenpai

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
Top