PDA

View Full Version : Solved: Code to insert a row at the end of the current sheet



Duncs
10-13-2008, 05:45 AM
I've got a spreadsheet that staff use to record details of every call they take. Rather than having the spreadsheet filled with 65500 rows to accomodate formatting & validation rules, what I want to do is allow them to click a button at the top of the screen, which will go to the last row and insert a new row.

The top of the screen is sectioned off by the use of frozen panes, and the insertion of the row should copy the formatting / validation from the row above.

Can anyone assist?

Duncs

Bob Phillips
10-13-2008, 06:08 AM
Range("A2").End(xlDown).Offset(1, 0).Select
Rows(ActiveCell.Row - 1).Copy
ActiveCell.PasteSpecial Paste:=xlPasteFormats