Moving Data on a worksheet

Abgar

Active Member
Joined
Jun 20, 2009
Messages
265
Hi guys,

Hopefully a quick and easy one - i have copied some data from an external application to Excel, and the information copies as one continuous ROW of data, where it should be split across rows.
A basic example:
Excel Workbook
ABCDEFGHI
1111213212223313233
Sheet1


And i need to the outcome to be similar to:
Excel Workbook
ABC
1111213
2212223
3313233
Sheet1


In the above example, the data is in sets of 3, but in my actual example, it is in sets of 15 (i.e. i would need A1:N1 to stay on row 1, and then O1:AC1 should be moved to be A2:N2 etc etc).

Hoping for an editable solution, that i can quickly change the number of cells if required, and also suit variable numbers of data sets.

Any help is always appreciated :)

Thanks so much :)
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Sorry to bump the post, but does anyone have any ideas on this?

Even if you can point in the right direction?

Cheers so much :)
 
Upvote 0
Code:
Sub G()

    Dim i As Integer, j As Integer, f As Integer, iUBound As Integer
    Dim arr As Variant, arrNew() As Variant
    
    arr = WorksheetFunction.Transpose(Range("A1", Range("A1").End(xlToRight)))
    iUBound = CInt(UBound(arr) / 3) + 1
    ReDim arrNew(1 To iUBound, 1 To 3)
    
    f = 1
    For i = 1 To UBound(arr, 1)
        j = j + 1
        arrNew(f, j) = arr(i, 1)
        If i Mod 3 = 0 Then
            j = 0
            f = f + 1
        End If
    Next
    
    Range("A3").Resize(UBound(arrNew, 1), 3) = arrNew

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,822
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top