Macro for copying and pasting specific cells

Arthas

New Member
Joined
Jun 11, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Dear All,

I am struggling with a macro that will:
  • Find "Company name" in column B
  • Copy value below "Company name" to row in a new sheet
  • Then look for "Entity name" (can be multiple items) also in column B and assign entity name to Company Name
Entity names are always starting from the 4 row in column B and I would like to have Entity Name next to Company Name (let's say in column B in a new sheet)

Final result would be like that:
Company Name Entity Name
XXXXX AAAAA
XXXXX BBBBB
XXXXX CCCCC
YYYYY AAAAA
YYYYY BBBBBB

Could you please support me with some loop that can perform such aggregation?

Thank you in advance!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach screenshots (not pictures) of your sheets. Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).
 
Upvote 0
Sure, this is how it looks like:

Excel.PNG


As mentioned, I would like to match Company name (cell with number) with Entity name.
If there are more entity names, I would like to repeat the Company name.
Both (Company name and Entity name) to be in separate rows next to each other.
 
Upvote 0
It is hard to work with pictures. Please see instructions in Post #2. Please include both sheets and explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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