+ Reply to Thread
Results 1 to 11 of 11

Modify a line into several lines

  1. #1
    Registered User
    Join Date
    05-30-2010
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    5

    Modify a line into several lines

    Hi everyone,


    I'm currently developing an excel file to import data into an Access database which will manage the fixed asset of my company.

    My problem is the following: so I have an excel file which gathering all invoices of every fixed asset. In my database, each F/A has it's own TAG and must have it's own invoice.
    The problem occur when in one invoice we found several assets.

    What i'm trying to do is when the quantity is over 1, excel must duplicate the line and modify the quantity. For example if at the beginning the quantity is 3 at the and I have 3 line with quantity 1.
    Furthermore, as I said before each F/A has is own TAG. After excel made a line for each F/A I would like to redistribute the TAGs.
    On the original line if their is several items the TAG are separated by a coma. And if an item doesn't have a TAG the default value will be Spare

    I enclose a sample of what I would like. The first sheet is the original file and the second sheet is the target.

    Thanks every for your help

    Merci à tous pour votre aide
    Last edited by julien4266; 06-07-2010 at 08:53 PM. Reason: Problem solved

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Modify a line into several lines

    Hi julien4266

    Sample files don't appear to be attached.

    John
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    05-30-2010
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Modify a line into several lines

    Should be updated now
    Attached Files Attached Files

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Modify a line into several lines

    Hi julien4266

    I'll look at this tonight.

    John

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Modify a line into several lines

    Hi julien4266

    It appears there's a problem with line 10 of your original data. You have a Qte of 5 but a TAG of only 4. I'm going to assume the extra item is a Spare but it shouldn't matter. However, these must match or you'll get incorrect data.

    I may post an offered solution soon.

    John

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Modify a line into several lines

    Hi julien4266

    This code is included in the attached workbook (your sample data).
    Please Login or Register  to view this content.
    It appears to do what you requested. Let me know of issues.

    John
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-30-2010
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Modify a line into several lines

    Quote Originally Posted by jaslake View Post
    Hi julien4266

    It appears there's a problem with line 10 of your original data. You have a Qte of 5 but a TAG of only 4. I'm going to assume the extra item is a Spare but it shouldn't matter. However, these must match or you'll get incorrect data.

    I may post an offered solution soon.

    John
    Hey John
    In this case we have qte 5, 4 item are tagged at the beginning because we know where they go and which tag they have. The last item will go as a spare part.
    The idea is if we have for exemple qty 6 and only 3 TAGs we will have 6 lines. Three of them with the dedicated TAG and the others three will go as Spare parts. But in the cell TAG spare will be written only once

    Thanks for your help

  8. #8
    Registered User
    Join Date
    05-30-2010
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Modify a line into several lines

    Quote Originally Posted by jaslake View Post
    Hi julien4266

    This code is included in the attached workbook (your sample data).
    Please Login or Register  to view this content.
    It appears to do what you requested. Let me know of issues.

    John
    Thanks that's very close to what i want to do. Do you think it's possible to change the quantity to 1 for all lines after the process?
    The other thing will be to put Spare as a default value if their is no TAG in this way if their is several spare in one line at the beginning, we don't have to write it.
    Thanks a lot already for what you have done. It's already very good.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Modify a line into several lines

    Hi julien4266
    With the code in the attached workbook, if you have more units than you have tags, the units without tags are assigned a tag value of "Spare" and all unit quantities are changed to 1.
    Let me know of issues.
    John
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-30-2010
    Location
    China
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Modify a line into several lines

    Quote Originally Posted by jaslake View Post
    Hi julien4266
    With the code in the attached workbook, if you have more units than you have tags, the units without tags are assigned a tag value of "Spare" and all unit quantities are changed to 1.
    Let me know of issues.
    John
    At the first sight it seems perfect to me. Thanks you very much for your help.
    Well done.

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Modify a line into several lines

    Hi julien4266

    Glad you're pleased. If you're satisfied with the solution, please mark your post as "SOLVED". If you're so inclined, click on the scales for style points. It's been a pleasure.

    John

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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