+ Reply to Thread
Results 1 to 7 of 7

Inserting Row at top of table

  1. #1
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Inserting Row at top of table

    Greetings all!

    I have a simple bit of code to insert a table row between the 2nd and 3rd row, 1st row is headers. Then I copy line 2 to the newly inserted line 3 then clear contents on line 2. The purpose is to be able to enter data at the top of the table rather than adding rows at the bottom (I'm quirky that way).

    Anyway, this is taking 4 lines of code, and it seems to me that it could be shorter. Any Suggestions?

    Please Login or Register  to view this content.
    Thanks for taking a look!
    Last edited by jacob@thepenpoint; 12-19-2013 at 10:28 AM.
    Jacob Albers
    Excel 2003 & 2010

  2. #2
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    286

    Re: Inserting Row at top of table

    Hi, Jacob

    So, rephrasing your earlier post, you have a column of data, with a blank row at the top, just underneath the headers.
    You want to be able to add data into the various columns, and at the end of data entry (this is the rub, isn't it) to push everything down and addin a new blank line (ready for the next data entry).

    If this is the case, then you can eliminate 99% of your requirements, and say:
    At the end of data entry, insert a new row in row 2. (Same caveat about detecting the 'end-of-data-entry' condition.

    Does this restructuring make sense?

    HTH

    Tony

  3. #3
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Inserting Row at top of table

    Question: why don't you just insert a row just below the title row (as row number 2)?
    Click on the star if you think I helped you

  4. #4
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Re: Inserting Row at top of table

    The problem I run into just adding a row below the header is that it copies the format of the header row. This code snippet is the way I was working around this problem. I normally just add the row as I am about to add data.

  5. #5
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Inserting Row at top of table

    Try This,


    Please Login or Register  to view this content.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  6. #6
    Forum Contributor
    Join Date
    10-16-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2003, 2010
    Posts
    151

    Re: Inserting Row at top of table

    Thanks xlbiznes, that works. I just needed to modify it to look at the table only instead of the entire row.

  7. #7
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Inserting Row at top of table

    You are welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] One formula in a table is not autofilling when inserting a row
    By chrisb84 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-15-2013, 05:14 AM
  2. Automatically Inserting a new Table Row
    By Trachr in forum Excel General
    Replies: 3
    Last Post: 05-07-2013, 07:46 PM
  3. [SOLVED] inserting new row in a table using command buton vba
    By hb316 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-01-2013, 11:09 AM
  4. Inserting rows in a table
    By Pat Jordan in forum Excel General
    Replies: 4
    Last Post: 11-13-2011, 03:46 PM
  5. Inserting table in Excel
    By markwilest in forum Excel General
    Replies: 1
    Last Post: 05-15-2007, 05:57 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1