Insert New Rows w/ Macro

ruckuz

New Member
Joined
Dec 28, 2010
Messages
36
Hi. This is the macro that I currently have. As you can see it starts w/ rows(21:21), however, if row 21 is enter and you run the macro again, it starts again at row 21 hence copying down whatever is currently in row 21 to 22. I do not want this macro to do that. i want it to start at the next empty row if previous rows are occupied. how do i do that? Thanks.
<!-- BEGIN TEMPLATE: bbcode_code -->
Code:
<STYLE>.alt2 font {font: 11px monospace !important;color: #333 !important;}</STYLE>

Sub NewJob()''

NewJob Macro'
To insert new jobs.

Rows("21:21").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("I20").Select
Selection.Copy
Range("I21").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("K20").Select
Selection.Copy
Range("K21").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("O20").Select
Selection.Copy
Range("O21").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A26").Select
End Sub
</PRE>
 
Last edited:

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
i edited my original post so it'll be easier to read. please help. thanks and happy new year everyone!
 
Upvote 0
are you inserting data or just adding it onto the bottom of your sheet
 
Upvote 0
are you inserting data or just adding it onto the bottom of your sheet

The purpose of this macro is to copy a few formulas from certain column above and replicate it in the row below the last set of data. i recorded w/ a blank row 21 and set a macro to copy the data from row 20. however, once i enter data into row 21 and then click the macro again, a new row will start between 20 and 21, making my current data in row 21 to row 22, hence a gap between 20 and 22.
 
Upvote 0

Forum statistics

Threads
1,215,599
Messages
6,125,751
Members
449,258
Latest member
hdfarid

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