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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,221,526
Messages
6,160,340
Members
451,637
Latest member
hvp2262

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