Thread: Moving cells
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tatebana Tatebana is offline
external usenet poster
 
Posts: 20
Default Moving cells

Thank you Charles,

I wrote the following:

On running it I got a Run-Time Error 1004: "Application defined or Object
defined Error"

Where did I mess up?



"Charles Chickering" wrote:

Here's a macro that cuts everything from the currently select cell down to
the first blank and move it one cell right and one cell up:
Sub MoveRightUp()
Range(ActiveCell,Activecell.End(xlDown)).Cut ActiveCell.Offset(-1,1)
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"Tatebana" wrote:

All data is kept in a single column, the number of rows varies (up to 2ooo)

How to move the cells in col. A:A next to the higher cell in Col. B:B?

Example:

A2 goes to B1 (row 2 thereby is empty now)
A4 goes to B3 (row 4 thereby is empty now)
A6 goes to B5 (row 6 thereby is empty now)
etc.

I´m sure there is a better way than record a macro that does it one by one.
(And where to stop?)