+ Reply to Thread
Results 1 to 5 of 5

Inserting rows in tables

  1. #1
    Registered User
    Join Date
    09-10-2009
    Location
    Perth, Western Australia
    MS-Off Ver
    Excel 2013
    Posts
    47

    Inserting rows in tables

    Hi there
    I often have to carry out this process and wonder if anyone is able to show me how to speed it up. I have inserted some dummy data and column names into Tables 1 & 2 (attached) to show what I do.

    Essentially, I need to line up the rows with the same Match Number so I can show the differences between the two tables. I have done the area highlighted in yellow. What I do is highlight the row in table 1 or 2 that does not match and insert a row using the code below:


    Please Login or Register  to view this content.

    This is a tedious and time-consuming process as I must find the non-matching rows, highlight the row in the table with the higher number then click a button I have on my toolbar which inserts a row above the highlighted row. The number of rows can vary from a few hundred to a few thousand.
    I am wondering is it possible to either:
    a) Select the row in just the first column in the table (i.e.a or g) and have the rest of the row to the end of the text automatically highlighted (i.e to either column e or column k). This would save me having to highlight the row.; or
    b) and this would be magic, is there any way of highlighting the whole selection and having it automatically insert rows where the Match numbers are not the same.

    Thanks in advance to anyone who looks at this and takes the trouble to reply.

    datafiend
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Inserting rows in tables

    Hi Datafiend,
    try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-10-2009
    Location
    Perth, Western Australia
    MS-Off Ver
    Excel 2013
    Posts
    47

    Re: Inserting rows in tables

    Thanks, Nilem. That may be part of the solution but it's not exactly doing what I want. The Match numbers that are the same need to end up on the same row. Where they are different they need to be on a row by themselves. I've inserted the rows in the section highlighted in yellow to show how it needs to appear. So, in the section below that, for example, row 12 in Table 1 needs to drop down 1 row so that it lines up with Match number 5867 in Table 2.

  4. #4
    Registered User
    Join Date
    09-10-2009
    Location
    Perth, Western Australia
    MS-Off Ver
    Excel 2013
    Posts
    47

    Re: Inserting rows in tables

    I've now worked out how to do part a) of my query above by using the following code:
    Please Login or Register  to view this content.
    Is it possible to do the magic part by doing the whole operation in one hit?

    Thanks

    datafiend

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Inserting rows in tables

    maybe so
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. VBA for inserting pivot tables
    By tdf2437 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-16-2016, 04:56 PM
  2. Inserting new rows into Excel tables using VBA
    By ArnabKGhosal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2016, 11:24 AM
  3. [SOLVED] Inserting different tables depending on the cell value?
    By andyzz in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-27-2014, 04:18 AM
  4. Replies: 0
    Last Post: 05-20-2014, 11:58 AM
  5. Inserting query tables
    By bookworm121 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2013, 12:53 AM
  6. Inserting lines into tables
    By AussieDave in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-03-2006, 04:40 PM
  7. Pivot tables - inserting columns
    By Scott in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2005, 10:06 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