Thread
:
Macro to Insert and copy entire row
View Single Post
#
1
Posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
Posts: 10,124
Macro to Insert and copy entire row
Give an illustration or send me a workbook.
--
Don Guillett
SalesAid Software
"CCrew2000" wrote in message
...
Two issues:
1) a row wasn't inserted
2) values were copied as well
"Don Guillett" wrote:
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
--
Don Guillett
SalesAid Software
"CCrew2000" wrote in message
...
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
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett