Consulting

Results 1 to 2 of 2

Thread: Solved: Code to insert a row at the end of the current sheet

  1. #1
    VBAX Regular
    Joined
    May 2008
    Posts
    21
    Location

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

    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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Range("A2").End(xlDown).Offset(1, 0).Select
    Rows(ActiveCell.Row - 1).Copy
    ActiveCell.PasteSpecial Paste:=xlPasteFormats
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •