+ Reply to Thread
Results 1 to 12 of 12

Copy then paste/insert X number of times

  1. #1
    Registered User
    Join Date
    10-18-2008
    Location
    Scotland
    Posts
    39

    Copy then paste/insert X number of times

    Hi,
    Im trying to figure out a way to make a packing list/ bill of materials one a list on one sheet.
    Im not sure how best to explain it so have made a sample excel file to illustrate what i mean.
    On the first sheet the items are entered and on the last sheet the packing list is built.
    I would prefer to use formula's if possible and think the easiest way would be to buildthe info i want copied on another sheet then copy or insert it the right number of times to create the packing list.
    im sure I havent given you enough info but Im sure youll let me know what I have missed out.

    Thanks for your help
    Cheers
    Steve.
    Attached Files Attached Files

  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: Copy then paste/insert X number of times

    Hi Steve

    I don't have the expertise to do this with formulas but the attached file with VBA code appears to do as you described.

    Let me know of issues.

    John
    Attached Files Attached Files
    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
    10-18-2008
    Location
    Scotland
    Posts
    39

    Re: Copy then paste/insert X number of times

    John,
    Thanks for that, I think its part of the way.. but if I change all the qty's to 3 I dont get the right result.
    If i could get the item number and description to jump to the packing list ok then I could probably pull the other details in using vlookup quite easily.
    Its just that with functions I have a better chance of being able to tweak it as I know nothing about VBA
    Cheers
    Steve

  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: Copy then paste/insert X number of times

    Hi Steve

    Just a small error in coding. This should get it.

    I'll work on this for you and post today in the event you wish to go another direction
    get the item number and description to jump to the packing list
    John
    Attached Files Attached Files

  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: Copy then paste/insert X number of times

    Hi Steve

    The procedure in this file populates the Packing List with the basic raw information from Sheet1 but does not break the items down to their elements. The lines that are commented out (') prevent this from happening.

    John
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-18-2008
    Location
    Scotland
    Posts
    39

    Re: Copy then paste/insert X number of times

    John,
    Thanks for all your efforts but the new version doesnt do the required at all.. it just seems to repeat sheet 1.

    Cheers
    Steve

  7. #7
    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: Copy then paste/insert X number of times

    Hi Steve

    Which "New Version" are you referring to Example Book1 or Example Book2.

    Example Book1 has the fix for this
    I change all the qty's to 3 I don't get the right result
    Whereas Example Book2 does this and only this
    If i could get the item number and description to jump to the packing list
    It doesn't do anything else as I understood you were going to
    pull the other details in using vlookup
    Test Example Book1 and let me know if it doesn't work. It sounds to me like Example Book 2 is working as designed.

    John

  8. #8
    Registered User
    Join Date
    10-18-2008
    Location
    Scotland
    Posts
    39

    Re: Copy then paste/insert X number of times

    John,

    "If i could get the item number and description to jump to the packing list ok then I could probably pull the other details in using vlookup quite easily" meant if Example book 1 worked wonderful, if not Example book 1 could at least build the packing list with item numbers and description then great.
    Meaning as example 1 but just the firat two colums no need for Colour Material and age ... as it just makes it more complex...
    Am iI confusing things ?

    Cheers
    Steve.

  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: Copy then paste/insert X number of times

    Hi Steve

    A bit of confusion going on. I fixed example 1 but didn't relable it. I'm attaching example 1.1 which has this fix
    if I change all the qty's to 3 I dont get the right result
    It should do as required. Let me know of issues.

    John
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    10-18-2008
    Location
    Scotland
    Posts
    39

    Re: Copy then paste/insert X number of times

    John,
    Thats perfect,all i need to do is try and understand which bits of the VBA point to which bits of the sheet.
    I dont understand VBA at all sorry.
    Ill have a look at the VBA and ask,try to lean if you dont mind.

    Cheers
    Steve

  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: Copy then paste/insert X number of times

    Hi Steve

    Don't mind at all. I'll take some time this weekend and comment the code for you. Perhaps that'll help. In the meantime, any questions, please feel free to ask.

    John

  12. #12
    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: Copy then paste/insert X number of times

    Hi Steve

    The attached workbook has comments on the Code lines that may help you follow what the Code is doing. In documenting the Code, I changed/modified some of the lines but the functionality is the same.

    If you have questions, please feel free to ask.

    John
    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)

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