Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Moving Cells
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Moving Cells
Hi
see your other posting P.S.: please don't multipost -- Regards Frank Kabel Frankfurt, Germany DaveB wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Moving Cells
Hi Dave,
A simple macro Sub MoveEm() Dim i As Long Dim cLastRow As Long Dim rng As Range Application.ScreenUpdating = False cLastRow = Cells(Rows.Count, "A").End(xlUp).Row Cells(1, "B").Value = Cells(2, "A").Value Set rng = Range("A2") For i = 3 To cLastRow Step 2 Cells(i, "B").Value = Cells(i + 1, "A").Value Set rng = Union(rng, Cells(i + 1, "A")) Next i rng.EntireRow.Delete Application.ScreenUpdating = True End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "DaveB" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Moving text around cells without moving boarder lines | Excel Discussion (Misc queries) | |||
Enter Key + Dragging Cells / Moving Cells | Excel Discussion (Misc queries) | |||
Arrow Keys Moving Window Frame instead of Moving Between Cells | Excel Discussion (Misc queries) | |||
Moving between cells | Excel Discussion (Misc queries) | |||
moving cells | Excel Worksheet Functions |