I have one column of data (column A) in blocks of 4 or 5 items, separated by an empty row.
I want to copy the 4 or 5 cells of data and then copy it, and paste it (transposed), into the row of the first data item of that group into the next column (B).
My macro worked until I saw that some of the data groups were 5 rows and not 4.
I can't figure out how to accommodate the instances of 5 vs. 4.
I tried searching for various ideas using isempty or similar but my loops kept getting fouled.
Here is my code that works except that the groups with 5 throws off the pasting.
Sub transposer2()
Dim R, c, d As Integer
R = 1
c = 1
For d = 1 To 500
Range(Cells(R, c), Cells((R + 4), c)).Select
Selection.Copy
Cells(R, 2).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
R = R + 6
Next d
End Sub
Thanks,
Bob
Bookmarks