Move contents of cells within Excel file

gregfthompson
gregfthompson used Ask the Experts™
on
In the attached xlsx file, the request is for the contents of every second row in column B to be moved up to the row above, in column M.
Example is show for the first two cells that have been moved.
TV-by-channel-example.xlsx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
Hi,

pls try
Sub Macro()

For Idx = 3 To Range("B" & Rows.Count).End(xlUp).Row Step 2
    Set c = Cells(Idx, 2)
    c.UnMerge
    c.Offset(-1, 11).Value = c.Value
    c.ClearContents
Next
End Sub

Open in new window

regards

Author

Commented:
Beautiful work.

Thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial