View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default How do I create a macro to duplicate the current row?

Sub insertsamelinerow()
Rows(ActiveCell.Row).Copy
Rows(ActiveCell.Row + 1).Insert
Application.CutCopyMode = False
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"lorenzo" wrote in message
...
I want to create a macro that will insert a blank row beneath the current
row
and will then copy the contents of the current row to the inserted row.

I can do the operation manually but when I record it as a macro then run
the
macro it is not quite right. It works fine if I want to add just one new
row. However, when I need run the macro to add further rows the macro
always
returns me to the point (row) where the I ran it for the first time. Does
anyone know what I need to put into the macro, when editing it, to stop
this
happening?