Moving Cells

  • Thread starter Thread starter DaveB
  • Start date Start date
D

DaveB

I have 3,000 rows in my worksheet. I just want to move
every other row up one line:

Smith, John (cell A1)
Biology Dept (cell A2)

I want to move cell A2 to B1...and

Jones, Sam (cell A3)
Anesth Dept (cell A4)

I want to move cell A4 to B3..and so on throughout my
worksheet. Thanks for the code in advance.

DaveB
(e-mail address removed)
 
Hi Dave
try the following macro:
sub move_cell()
Dim RowNdx As Long
Dim LastRow As Long
Application.ScreenUpdating = False
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = 2 to LastRow step 2
cells(RowsNdx-1,2).value=cells(RowNdx,1).value
cells(RowNdx,1).clearcontents
Next RowNdx
Application.ScreenUpdating = True
End Sub
 
You can do this with some formulas and helper columns:

in B1: =IF(ISEVEN(ROW(A2)),A2,"")
C1: =IF($B2="",A1,"")
copy C1 to D1.

Then copy B1:D1 down 3000 rows. Then copy n' paste special, and sort out the
spaces.
 

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

Similar Threads

Moving Cells 2
Moving Cells 1
Can cells be split ? 5
Using two Vlookup in one Cell 1
Comparison of columns using Conditional Formatting 3
Help Creating Excel Formula 4
Cell referencing 10
Calculations 1

Back
Top