Macro to repeat rows in the same excel

m.hamadeh

New Member
Joined
Jun 14, 2011
Messages
32
I made a template for me engineer to report installation status, sometimes they do single installation other times multiple installations is happening.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
The template contains the following row, some field with preselected dropdown lists.<o:p></o:p>
<o:p></o:p>
Customer Name, Address, status, follow up<o:p></o:p>
<o:p></o:p>
I need to create a button next to the row, pressing the button will insert a new row after the original row with the same fields for the next customer to report multiple installations.<o:p></o:p>
<o:p></o:p>
Please help me the VP needed.<o:p></o:p>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Code:
Sub Macro1()
Dim myRow As Integer
myRow = Selection.Row
    Rows(myRow).Copy
    Rows(myRow + 1).Select
    ActiveSheet.Paste
End Sub

put this in a module.
Inset a command button(form control) and attach this macro to it.
The code shouild retain any dropdowns that you want to keep.
 
Upvote 0
The macro worked. However I have to select the row before is there a way to pre-fix the needed range in the macro (the data needed to be copied located within A10:U11).<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p> </o:p>
Also my template is containing data after the (installation row) I don’t need the data to be over written; only I need to insert.
 
Upvote 0

Forum statistics

Threads
1,224,543
Messages
6,179,427
Members
452,914
Latest member
echoix

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top