Forum Discussion
Convert 912 rows and 16 columns into 2 columns....with a twist
- Jul 29, 2020
You may open the file, Data->Query and Connections, on the right pane double click on query (or Edit from right click menu), query editor will be opened, here you will see the steps
Have you used Macros ?
This code picks colors from right to each product.
It is important to select first product-code as activecell
before running this code.
Select first product-code from your list and run this code.
You can make this actions to a copy of your original data.
The macro picks up colorinformation from right to activecell ( 14 columns )
and adds a row for new color if needed. Macro stops when activecell value
is empty.
Sub ColumnsToRows()
Dim X As Integer
Dim Y As Integer
Y = 0
Do While ActiveCell.Value <> ""
For X = 2 To 15
If ActiveCell.Offset(0, X).Value <> "" Then
ActiveCell.Offset(1, 0).EntireRow.Insert Shift:=xlDown
ActiveCell.Offset(1, 0).Value = ActiveCell.Value
ActiveCell.Offset(1, 1).Value = ActiveCell.Offset(0, X).Value
Y = Y + 1
End If
Next X
ActiveCell.Offset(Y + 1, 0).Select
Y = 0
Loop
End Sub