I tried to run the code in Post #14, but kept getting a 1004 run-time error as soon as it hit the For loop's active line of code, so I don't know how fast that code is. I didn't try to debug it, but is it expecting a certain type of data in a specific location? I used A1 copied down in Column A, B1 copied down in Column B and so on for my data.
I tested my code against a 20,000 row set of data and it moved the columns in just under 7.5 seconds. That seemed kind of fast to me, hence my claim. If I could get the code you referred to working, I'd be happy to test it on my computer for a comparison using the same hardware for both tests. I did not see an gaps (mysterious or otherwise) when I reran the code.
Regarding data location, the requirements of the thread were specified in Post#1 (columnQ to ColumnA etc), and the way I approached this was to list OP's origins and destinations (in letters, as specified in Post#1) in the first two columns of Sheet2.
This was explained in some detail in Post#4, to ensure there wouldn't be 1004 or similar errors.
OP seemed to have no trouble running the code in Post#13. I tested it before posting to check for possible errors. I'm surprised that you got errors.
I generated 20,000 row data generated with the following testdata code.
Code:
Sub testdata()
Sheets("sheet1").Activate
ActiveSheet.UsedRange.ClearContents
Dim n, m
n = 20000: m = 19
With [a1].Resize(n, m)
.Cells = "= int(rand()*20)+1"
.Resize(1) = "=char(column()+64)"
.Value = .Value
End With
End Sub
It seems to me that your 7.5 secs is
very slow to re-order these data, and in fact running your code took 0.38 secs on an i7 processor laptop with Excel 2007 (maybe your data were quite different). My code in Post#13 took 0.11 secs for same data.
With 60,000 rows your code took 1.04 secs, mine took 0.25 secs.
With 100K rows yours gave type mismatch error, mine took 0.40 secs.
Wih 1 million rows, my code took 3.6secs. Yours gave type mismatch.
Whatever your preferred terminology, it could be said that your code is relatively slow. I took your use of "very fast" to be relative to other posts made in this thread, which is the obvious standard of comparison. If you didn't mean this (or even if you did), all OK by me, no problem to anyone.
Regarding data deletions, if you run your code on test data, then run it again
on the re-ordered data, you should see gaps readily enough. The reason seems obvious enough - your deletion of the original ColumnA. Probably wouldn't matter for this thread, but for some matrix work (for example) where this kind of approach could be used it might matter a lot.