Pierre73953
Pierre73953

Reputation: 13

Basic copy loop problem with range & column iteration

how can i turn the following into a 500x loop?

Range("A14:A6368").Cut Range("B1")
Range("B14:B6368").Cut Range("C1")
Range("C14:C6368").Cut Range("D1")

Basically, I copied a table on the web, when I paste into excel, I get it all in 1 column. Must be simple, but I've spent hours googling and I cannot find the solution!

Thank you!

Upvotes: 1

Views: 37

Answers (1)

BigBen
BigBen

Reputation: 50162

Something like the following perhaps:

Dim i As Long 
For i = 1 To 500
    Range(Cells(14, i), Cells(6368, i)).Cut Destination:=Cells(1, i + 1)
Next

You can also use Offset.

Dim i As Long
For i = 0 To 499
    Range("A14:A6368").Offset(, i).Cut Destination:=Range("B1").Offset(, i)
Next

Upvotes: 1

Related Questions