View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Transpose to break up one long row to many?

Try this to move in blocks of 5

Option Explicit
Sub breakrowtorows()
Dim i As Long
Dim j As Long
Dim r As Long

Application.ScreenUpdating = False
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
r = 1
For j = 1 To Cells(i, Columns.Count).End(xlToLeft).Column Step 5
Cells(i, j).Resize(, 5).Copy
Cells(i + r, 1).Insert Shift:=xlDown
r = r + 1
Next j
Rows(i).Delete
Next i
Application.ScreenUpdating = True
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Andym" wrote in message
...
Hi All
I have a problem i hope you can help with. The sheet i have has rows of
many
columns, what i need to do is leave the first 5 columns of data and
underneath that row insert the next 5 columns of data, then the same again
with 4 columns, 5 columns, 4 columns. One the has done move to the next
original row and repeat till the end. Any suggestiosn on a macro to help?
Thanks