Inserting a row after last row of data

easybpw

Active Member
Joined
Sep 30, 2003
Messages
406
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
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

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
406
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
 

Watch MrExcel Video

Forum statistics

Threads
1,114,051
Messages
5,545,727
Members
410,702
Latest member
clizama18
Top