I have written and used simple Excel Macro to reformat an Excel workbook. It is a simple loop that cut and pastes cells and stops when the cell is empty (i.e. when it reaches the bottom of the page).
The macro works fine on my laptop with Excel 2013. The file doesn't work for my colleague who has Excel 2016. My colleague finds that Selection.cut doesn't remove the old, it leaves the old cell contents in place so the while loop finishes early.
We have tried with literally the same file and the same contents and it works for me, but not my colleague. We think it might be some difference between Excel 2013 and 2016. Code is as follows:
Sub NewMACRO()
Dim y As Integer
Dim row As Integer
Dim test As String
y = 1
row = 1
test = "test"
Do While test <> ""
Cells(y, 1).Select
Application.CutCopyMode = False
Selection.Cut
Cells(row, 1).Select
ActiveSheet.Paste
y = y + 2
Cells(y, 1).Select
Selection.Cut
Cells(row, 2).Select
ActiveSheet.Paste
y = y + 2
Cells(y, 1).Select
Selection.Cut
Cells(row, 3).Select
ActiveSheet.Paste
y = y + 2
Cells(y, 1).Select
test = Selection
row = row + 1
Loop
Cells(1, 1).Select