Macro to Insert and copy entire row

G

Guest

I'm trying to create a macro that goes to the last row of data, goes to the
next row and then inserts a row. I then need it to copy & paste from the row
above it (formulas & formats only). Here is what I have so far, but its not
working.

range("A7").Select
Selection.End(xlDown).Select , Offset(1, 0)
Selection.EntireRow.Insert

range("NewPartDescr").Offset(-2, 0).EntireRow.Copy
range("NewPartDescr").Offset(-1, 1).EntireRow.Select

Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Application.CutCopyMode = False
 
D

Don Guillett

Without selections.

Sub copylastrowdown()
lr = Cells(Rows.Count, "a").End(xlUp).row
Rows(lr).Copy
Rows(lr + 1).PasteSpecial Paste:=xlPasteFormats
Rows(lr + 1).PasteSpecial Paste:=xlPasteFormulas
'cells(lr + 1,"a").select 'uncomment to select
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

Top