Copy to column if cell matches certain value

jb1180

New Member
Joined
Dec 6, 2017
Messages
1
I have a 3 row spreadsheet that needs to be separated into multiple columns. Row 1 is the unique value. Row 2 will become the column name. Row 3 contains the data for the column. Ultimately will result in about 200 columns.

Is there a good formula that would accomplish this? Thanks in advance.

Sample Current format

[TABLE="width: 500"]
<tbody>[TR]
[TD]PART1[/TD]
[TD]MANUFACTURER[/TD]
[TD]NAME[/TD]
[/TR]
[TR]
[TD]PART1[/TD]
[TD]MANUFACTURER PART NUMBER[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]PART2[/TD]
[TD]MANUFACTURER[/TD]
[TD]NAME[/TD]
[/TR]
[TR]
[TD]PART2[/TD]
[TD]MANUFACTURER PART NUMBER[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]PART3[/TD]
[TD]MANUFACTURER[/TD]
[TD]NAME[/TD]
[/TR]
[TR]
[TD]PART3[/TD]
[TD]MANUFACTURER PART NUMBER[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]PART4[/TD]
[TD]MANUFACTURER[/TD]
[TD]NAME[/TD]
[/TR]
[TR]
[TD]PART4[/TD]
[TD]MANUFACTURER PART NUMBER[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]

Sample Desired output

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]MANUFACTURER PART NUMBER[/TD]
[TD]MANUFACTURER[/TD]
[/TR]
[TR]
[TD]PART1[/TD]
[TD]1[/TD]
[TD]NAME[/TD]
[/TR]
[TR]
[TD]PART2[/TD]
[TD]2[/TD]
[TD]NAME[/TD]
[/TR]
[TR]
[TD]PART3[/TD]
[TD]3[/TD]
[TD]NAME[/TD]
[/TR]
[TR]
[TD]PART4[/TD]
[TD]4[/TD]
[TD]NAME[/TD]
[/TR]
</tbody>[/TABLE]

****** id="cke_pastebin" style="position: absolute; top: 134px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="width: 500"]
<tbody>[TR]
[TD]MANUFACTURER[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I believe this is beyond a formulas type solution. You'll need a macro like this:
Code:
Sub Zipper()
    Dim i As Integer
    Dim finalRow As Integer
    
    Range("A1").EntireRow.Insert
    
    finalRow = Cells(Rows.Count, 1).End(xlUp).Row
    Range("B1").Value = "Manufacturer Part Number"
    Range("C1").Value = "Manufacturer"
    
    For i = 2 To finalRow
        If Cells(i, 1).Value = "" Then
            Exit For
        End If
        
        Cells(i, 2).Value = Cells(i, 3).Value
        Cells(i, 3).Value = Cells(i + 1, 3).Value
        Range("A" & i + 1).EntireRow.Delete
    Next i
    
    MsgBox "The macro has finished."
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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