Excel 2003 Macro to move data around worksheet

  • Thread starter Thread starter recorder
  • Start date Start date
R

recorder

I need to convert data for the three columns below by repeating these
 
Test on a copy of your workbook
Sub moveStuff()
Const columnA = "A"
Const columnC = "C"
Dim lastRow As Long
Dim i As Long

Range(columnA & 1).EntireRow.Insert
lastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row * 2

For i = 2 To lastRow
Range(columnA & i).Offset(-1, 0) = Range(columnC & i)
Range(columnC & i) = ""
Range(columnA & i).Offset(1, 0).EntireRow.Insert
i = i + 1
Next i

End Sub
 

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

Back
Top