Hi,
try this code
you have that you want in a New Worksheet.
1) press ALT+F11 to open the Visual Basic Editor
2) select Insert > Module
3) Copy and paste the code below on the right
4) close the VBE
Sub myConvert()
Dim WS, newWS As Worksheet
Dim t1, t2, t3, r As Long
Application.ScreenUpdating = False
Set WS = ActiveSheet
Set newWS = Worksheets.Add
r = WS.Cells(Rows.Count, 1).End(xlUp).Row
t1 = 0
t2 = 0
t3 = 0
For i = 1 To r
For j = 1 To 7 Step 3
t1 = t1 + 1
newWS.Cells(t1, 1) = WS.Cells(i, j)
Next j
For j = 2 To 8 Step 3
t2 = t2 + 1
newWS.Cells(t2, 2) = WS.Cells(i, j)
Next j
For j = 3 To 9 Step 3
t3 = t3 + 1
newWS.Cells(t3, 3) = WS.Cells(i, j)
Next j
Next i
Application.ScreenUpdating = True
End Sub
To run the macro...
1) press ALT+F8 to show the Macros window
2) select the macro "myConvert"
3) press Run.
As number of columns
is a multiple of the number
3, try
this code, which is
generalization of the previous one.
Sub GeneralCode ()
Dim WS, newWS As Worksheet
Dim t1, t2, t3, r, c As Long
Application.ScreenUpdating = False
Set WS = ActiveSheet
Set newWS = Worksheets.Add
r = WS.Cells(Rows.Count, 1).End(xlUp).Row
c = WS.Cells(1, Columns.Count).End(xlToLeft).Column
t1 = 0
t2 = 0
t3 = 0
For i = 1 To r
For j = 1 To c - 2 Step 3
t1 = t1 + 1
newWS.Cells(t1, 1) = WS.Cells(i, j)
Next j
For j = 2 To c - 1 Step 3
t2 = t2 + 1
newWS.Cells(t2, 2) = WS.Cells(i, j)
Next j
For j = 3 To c Step 3
t3 = t3 + 1
newWS.Cells(t3, 3) = WS.Cells(i, j)
Next j
Next i
Application.ScreenUpdating = True
End Sub