Forum Discussion

ESCHOENN's avatar
ESCHOENN
Copper Contributor
Jun 07, 2022

Copy paste format- column to row by 3

Hello!

 

I have a large column of cells I need to have in rows of 3. I've been using transpose to do 3 at a time but for longer columns this gets a little tedious. Is there a way to copy and paste all at once and have the whole column change to the 3 across format I need?

I've tried highlighting as shown in the second picture but it ignores it and transposes them into one long row.

 

Attaching pictures for clarity.

 

 

 

  • ESCHOENN 

    Sub rowsof3()
    
    Dim i As Integer
    Dim j As Integer
    Dim z As Integer
    
    z = 4
    i = 1
    For j = 6 To 215
    
    Cells(z, i).Value = Cells(j, 8).Value
    i = i + 1
    
    If i = 4 Then
    z = z + 1
    i = 1
    
    Else
    End If
    
    Next j
    
    End Sub

    Maybe with this code. In the attached file you can click the button in cell E2 to start the macro.

  • ESCHOENN 

    Sub rowsof3()
    
    Dim i As Integer
    Dim j As Integer
    Dim z As Integer
    
    z = 4
    i = 1
    For j = 6 To 215
    
    Cells(z, i).Value = Cells(j, 8).Value
    i = i + 1
    
    If i = 4 Then
    z = z + 1
    i = 1
    
    Else
    End If
    
    Next j
    
    End Sub

    Maybe with this code. In the attached file you can click the button in cell E2 to start the macro.

Resources