Moving cells and creating columns according to a criteria in another cell

lucas_delarge

New Member
Joined
Feb 4, 2019
Messages
2
Hi friends, :biggrin:

I have to create a macro (or a formula) to do the following:

I need to get the supplier name when it appears on the below cell and transport to the same cell of the part number, adding new columns for them.

Column A --> is a structure index (not really important here)
Column B --> when I have "Supplied By Supplier (A>Sup)" I need to collect the same line value on "C" and "D" and move it to a column "E" and "F", but one line above to keep it in the same line of the father.

This is the previous table:

ABCD
3Uses Articles100000747---
3Uses Articles100000748---
3Uses Articles100120786---
4Supplied By Supplier315708909,LoctiteLoctite 5699
3Uses Articles3EER300000-2688---
4Supplied By Supplier516867611,Loctite7063 Cleaner

<tbody>
</tbody>


Should be like this:

ABCDEF
3Uses Articles100000747---
3Uses Articles100000748---
3Uses Articles100120786---315708909,LoctiteLoctite 5699
4Supplied By Supplier
3Uses Articles3EER300000-2688---516867611,Loctite7063 Cleaner
4Supplied By Supplier

<tbody>
</tbody>

I've tried a many combinations but it didn't work. If anyone knows how to solve this. :confused:

Thanks a lot!!!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi & welcome to MrExcel
How about
Code:
Sub lucas_delarge()
   Dim Cl As Range
   
   With Range("B:B")
      .Replace "Supplied By Supplier", "#N/A", xlWhole, , False, , False, False
      For Each Cl In .SpecialCells(xlConstants, xlErrors).Areas
         Cl.Offset(, 1).Resize(, 2).Cut Cl.Offset(-1, 3)
      Next Cl
      .Replace "#N/A", "Supplied By Supplier", xlWhole, , False, , False, False
   End With
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,575
Messages
6,120,344
Members
448,956
Latest member
Adamsxl

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