+ Reply to Thread
Results 1 to 5 of 5

Duplicating records by a quantity

  1. #1
    Registered User
    Join Date
    08-21-2006
    Posts
    4

    Duplicating records by a quantity

    Hi all,

    I have a spreadsheet with a set of stock data in it, and i need to split down the stock records by quantity to create individual records for each item for example:

    Q Item
    2 Pen
    3 Pencil
    1 Ruler

    would become:

    Pen
    Pen
    Pencil
    Pencil
    Pencil
    Ruler

    Thanks for the help on the last question which was similar, hoping this is possible too as i dont want to do it all by hand with over 3000 records to split!

    Thanks in advance,

    Nick

  2. #2
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by nd2006
    Hi all,

    I have a spreadsheet with a set of stock data in it, and i need to split down the stock records by quantity to create individual records for each item for example:

    Q Item
    2 Pen
    3 Pencil
    1 Ruler

    would become:

    Pen
    Pen
    Pencil
    Pencil
    Pencil
    Ruler

    Thanks for the help on the last question which was similar, hoping this is possible too as i dont want to do it all by hand with over 3000 records to split!

    Thanks in advance,

    Nick
    see the attached file, it may help you
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    Nice work starguy, will be helpfull for also
    Denis

    Please always attach the sample workbook without sensitive information when asking for help

    To add a module
    Press Alt + F11 (this is the Visual Basic Environment)
    Insert Menu, select Module
    Past code there
    Close Visual Basic Environment (X)

  4. #4
    Registered User
    Join Date
    08-21-2006
    Posts
    4
    Thanks for your help starguy, that is a useful method but i was hoping there would be an easier alternative, as that still means a huge amount of work.

    Preferable would be some kind of macro or VB script that went through the sheet and copied each row and pasted it in underneath the required no. of times from the quantity field.

    Is this possible?

    Thanks
    Nick

  5. #5
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    Not to pretty put should work if there is no more the 9 occurence of item
    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