+ Reply to Thread
Results 1 to 6 of 6

Moving rows of data to another excel sheet

  1. #1
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Moving rows of data to another excel sheet

    Hi,

    I have a script below that moves only one row of data from a csv file to an xls template and saves the filename as the that rows column A, but if I have more than one row with the same information except for the last 3 columns then I need them passed to the same template and saved.

    This is difficult for me to explain so I hope somebody understands.

    Please Login or Register  to view this content.
    Thanks for any help,

    David

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Moving rows of data to another excel sheet

    Not so sure I understand. Looks to me that if you have more than one row, the above macro will work. Which columns are the last three columns? I guessed G, H I. I may be way off on this, let me know.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Moving rows of data to another excel sheet

    Thanks John,

    I'm sorry what I put make no sense, here are the documents so you can see what happens when you run the macro in Orders.xls, it creates the packing lists for single item orders but for multiple item orders it overwrites the first row.

    David
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Moving rows of data to another excel sheet

    Hi,

    I keep trying to add an if statement within the loop just before the save the filename portion that if the order number is the same on the next row then write the following code:

    Please Login or Register  to view this content.
    and if the same order number is on the next line again do the following:

    Please Login or Register  to view this content.
    Thanks for any help,

    David

  5. #5
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Moving rows of data to another excel sheet

    Ok I have it working up to naming the files correctly, at the moment it is naming the files the next rows value in column A.

    Hope this makes sense I somebody can help?


    Please Login or Register  to view this content.
    Thanks anyway,

    David

  6. #6
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Re: Moving rows of data to another excel sheet

    Here's the solution just in case anybody needs it! (Highlighted in red)

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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