Inserting a row after last row of data

easybpw

Active Member
Joined
Sep 30, 2003
Messages
411
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Hi everyone! I have a spreadsheet for work that has a number of rows of data starting at row 1. In this example I have data in rows 1-118 and the total of the data is in row 121. I have created a userform that inputs the data for me. However every time prior to using the userform I have to manually insert more rows after row 118 so that I don't run out of room before my total line. What I would like is for a new row to be inserted after my last row of data BUT before my total line every time I open the userform I have created. Does this make sense?

Bill
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

SIXTH SENSE

Well-known Member
Joined
Oct 29, 2003
Messages
1,883
hi!
I got no more time!
but this will lead you near to a solution.
Range("a65536").End(xlUp).EntireRow.Insert Shift:=xlShiftDown

this will insert one row before the last row!
 

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
Hello,

try this code

Code:
    Range("A1").End(xlDown).Offset(1, 0).EntireRow.Insert
 

easybpw

Active Member
Joined
Sep 30, 2003
Messages
411
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Thanks for the help. Once I inserted the code in the correct place it is working like it should. Thanks again!

Bill
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,817
Messages
5,772,456
Members
425,760
Latest member
paphon

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
Top