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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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