Macro issue

G

Guest

Hello from Steved

Please how do I insert a row shift the cursor down one cell copy and then
paste to the above. I got about 10,000 rows to do. Thankyou.

Sub Broken()
Selection.EntireRow.Insert
Range("A61").Select
Selection.Copy
Range("A62").Select
ActiveSheet.Paste
End Sub
 
C

CaptainQuattro

Try this:


Sub Unbroken()

Selection.EntireRow.Insert
ActiveCell.Offset(1, 0).Copy
ActiveCell.PasteSpecial


End Su
 
B

Bob Phillips

Sub InsertRows()
Dim i As Long

Application.ScreenUpdating = True
For i = Cells(Rows.Count, "A").End(xlUp).Row To 1 Step -1
Rows(i).Insert
Rows(i + 1).Copy Cells(i, "A")
Next i
Application.ScreenUpdating = True
End Sub


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 
G

Guest

Thankyou Bob.

Bob Phillips said:
Sub InsertRows()
Dim i As Long

Application.ScreenUpdating = True
For i = Cells(Rows.Count, "A").End(xlUp).Row To 1 Step -1
Rows(i).Insert
Rows(i + 1).Copy Cells(i, "A")
Next i
Application.ScreenUpdating = True
End Sub


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)
 

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

Top