From column to rows

Atanas Kisyov

New Member
Joined
Dec 10, 2019
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi guys, I have a problem and I hope you can help me.
I have a table like the example bellow:

1575987516733.png


And I need it to transform like this:

1575987578112.png


I can use the transpose paste special, but there are around 10 000 rows...
Also some of "Material 1" have different qty of rows for "Material 2"

Example:

1575987791209.png
 

Attachments

  • 1575987750509.png
    1575987750509.png
    1 KB · Views: 4
  • 1575987760678.png
    1575987760678.png
    1.6 KB · Views: 5
  • 1575987765721.png
    1575987765721.png
    1.6 KB · Views: 3

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
The data is different for every "Material 1", some have one row and others have twenty rows...
 
Upvote 0
Yes, do you want the next group below the first group or to continue down the same row? You are just showing the outcome of 1 group
 
Upvote 0
See if this does it.

Code:
Sub t()
Dim i As Long
With ActiveSheet
    For i = .Cells(Rows.Count, 2).End(xlUp).Row To 2 Step -1
        If .Cells(i, 1) = "" Then
            Range(.Cells(i, 2), .Cells(i, Columns.Count).End(xlToLeft)).Copy _
            Cells(i - 1, Columns.Count).End(xlToLeft).Offset(, 1)
            Rows(i).Delete
        End If
    Next
End With
End Sub
 
Upvote 0
See if this does it.

Code:
Sub t()
Dim i As Long
With ActiveSheet
    For i = .Cells(Rows.Count, 2).End(xlUp).Row To 2 Step -1
        If .Cells(i, 1) = "" Then
            Range(.Cells(i, 2), .Cells(i, Columns.Count).End(xlToLeft)).Copy _
            Cells(i - 1, Columns.Count).End(xlToLeft).Offset(, 1)
            Rows(i).Delete
        End If
    Next
End With
End Sub

This works perfectly! Thank you!
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,091
Latest member
gaurav_7829

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