+ Reply to Thread
Results 1 to 6 of 6

Copy and paste data in to next blank row of a table

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    England
    MS-Off Ver
    Office 2010
    Posts
    13

    Copy and paste data in to next blank row of a table

    Hi

    I have the following code to copy and paste data to next empty row on another sheet, but it pastes it below the table I want to insert it in. I need to copy data from the ExceptImport table in to the ExceptionsTable table. E.g. ExceptImport[JobNumber] needs to go to ExceptionsTable[JOB NO] on the Exceptions sheet.

    I believe I have to use ListObject as the destination in some manner but I am not sure how to do it. Please could someone have a look and let me know how I can adapt this to what i need:

    Please Login or Register  to view this content.
    Regards
    Jason
    Last edited by jasonmcasey; 08-27-2014 at 04:39 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Copy and paste data in to next blank row of a table

    attach please a sample file
    If solved remember to mark Thread as solved

  3. #3
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Copy and paste data in to next blank row of a table

    Not sure if this is overkill, but you can try this:

    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  4. #4
    Registered User
    Join Date
    07-10-2014
    Location
    England
    MS-Off Ver
    Office 2010
    Posts
    13

    Re: Copy and paste data in to next blank row of a table

    Thanks Millz, that code does not work if there is no data in the table already and it only copies the first row from the ExceptImport table. I have attached a sample file which well help understand what I am trying to achieve.

    On the Exceptions Import sheet, I have an XML table that imports data from an XML file. I then need to copy the data as follows:

    From Sheet - Exceptions Import, Table ExceptImport, JobNumber column to Sheet - Exceptions, Table ExceptionsTable, JOB NO column
    From Sheet - Exceptions Import, Table ExceptImport, Time column to Sheet - Exceptions, Table ExceptionsTable, Time column
    From Sheet - Exceptions Import, Table ExceptImport, Comment column to Sheet - Exceptions, Table ExceptionsTable, Comments column
    From Sheet - Exceptions Import, Table ExceptImport, ShortCode column to Sheet - Exceptions, Table ExceptionsTable, Error Code column

    This is part of a larger file that is created once a week, I need to be able to copy that data to ExceptionsTable if it already has data in it or if it's blank.
    Attached Files Attached Files

  5. #5
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Copy and paste data in to next blank row of a table

    Hi jasonmcasey, try this amended code:

    Please Login or Register  to view this content.
    Last edited by millz; 08-13-2014 at 09:39 PM.

  6. #6
    Registered User
    Join Date
    07-10-2014
    Location
    England
    MS-Off Ver
    Office 2010
    Posts
    13

    Re: Copy and paste data in to next blank row of a table

    Hi Millz

    I did not get chance to work on this again until today but that works perfectly. Thank you very much for your help

+ 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] Copy data and paste in first blank row of Column A
    By Hood in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-08-2014, 08:48 AM
  2. Macro to Copy Pivot Table and Paste a Regular Data Table in the Same Position
    By webfeet2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2013, 06:34 AM
  3. Selection of loop data, move copy and paste data, and exclude blank rows
    By mav02004 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2013, 10:20 AM
  4. Copy Data Based on Criteria and Paste In Next Blank Row
    By Gingeiko in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-30-2011, 02:28 AM
  5. Excel 2007 : Copy data ok but paste blank!
    By gozo in forum Excel General
    Replies: 1
    Last Post: 07-24-2009, 08:35 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