Working with large group of numbers in a column

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to move every other number in a column of numbers to an adjacent
column and then close the gap. Example: Move a2 to b1 and delet row 2, move
a4 to b2 and delete row 4. I need to repeat this task 25,000 times.
Recording a macro doesn't seem to work.
 
Place the following formula in B1

=OFFSET($A$1,2*(ROW(A1)-ROW($A$1)),0)

and the following in C1

=OFFSET($A$1,2*(ROW(A1)-ROW($A$1))+1,0)

Copy the two formulas down as far as necessary. Select the formulas and use
Edit|Copy then Edit|Paste Special and choose the Values option to convert
the formulas to numbers. Now delete the A column.

The above formulas can be used on any column of numbers and it does not need
to start in row 1. Just change the A1 and $A$1 references to the first cell
in the column of numbers.
 
hornsby said:
I need to move every other number in a column of numbers to an adjacent
column and then close the gap. Example: Move a2 to b1 and delet row 2, move
a4 to b2 and delete row 4. I need to repeat this task 25,000 times.
Recording a macro doesn't seem to work.
If the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook

Sub qwerty()
Dim arr
arr = Range("a1:a25000")
arr = ArrayReshape(arr, 12500, 2)
Range("A1").Resize(12500, 2).Value = arr
Range("a12501:a25000").ClearContents
End Sub

Alan Beban
 

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