PDA

View Full Version : Split row to column with insert



parscon
08-25-2015, 01:47 AM
Hello
I want to split row to column that mean the data will be split in row start column D to O and if you check the below image for example in row we have data from D1 to F1 so i need automatically insert new row and make duplicate of column A and B and put data from D1 and ....

This is The data that i have

14245

and the result that i need will be like this .

14246

Also I attached the sample file.

snb
08-25-2015, 04:05 AM
Sub M_snb()
sn = Sheet1.Cells(1).CurrentRegion

With CreateObject("scripting.dictionary")
For j = 1 To UBound(sn)
For jj = 3 To UBound(sn)
If jj = 3 Or sn(j, jj) <> "" Then .Item(j * 100 + jj) = Array(sn(j, 1), sn(j, 2), sn(j, jj))
Next
Next

Sheet2.Cells(30, 1).Resize(.Count, 3) = Application.Index(.items, 0, 0)
End With
End Sub

parscon
08-25-2015, 04:18 AM
Thanks Dear snb but the result is not true . the result of your code is :

14250

and if you check it is different of mine for example if you check column A you must have 4 row of 52 but in your result we have 3 and if you check it does not insert column F , I need grab fro m column D to column O

snb
08-25-2015, 05:19 AM
In that case you will have to adapt the code.

parscon
08-26-2015, 09:05 AM
Please if possible help me for this subject .