How to split column?

  • Thread starter Thread starter Y. Belenky
  • Start date Start date
Y

Y. Belenky

Help please,
I've one long column (~65000 rows) of data in one sheet.
The question is how to split it to several columns
with 400 (for example) rows of the data in each?
Is there any known macro?
Thank you very much,
Y.B.
 
Sub AAA()
Dim i As Long, j As Long, n As Long
j = 0
For i = 1 To 65536 Step 400
j = j + 1
n = 400
If n + i > 65536 Then _
n = 65536 - i + 1
Cells(i, 1).Resize(n, 1).Copy Destination:= _
Worksheets("Sheet2").Cells(1, j)
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top