+ Reply to Thread
Results 1 to 4 of 4

Automatically create and fill rows based on a given quantity

  1. #1
    Forum Contributor
    Join Date
    08-10-2006
    Location
    The Netherlands
    MS-Off Ver
    Office for Mac 2016; MS Office 2016 for Windows
    Posts
    110

    Automatically create and fill rows based on a given quantity

    Hi all,

    I'm struggling with creating a macro which has to fill lines automatically, based on a certain qty.
    Attached file has sample data in it.
    The tab "outbound" starts on row 8 with the headers and in row 9 and below the data (partnumber, description, quantity etc).
    The tab "collection_1" has the data filled in already by myself as the desired result, but I need a macro to do that for me.

    so a row with a quantity 5 (column H on tab "outbound") need to be shown as 5 similar rows on tab "collection_1" (only difference is that column H on this tab will be 1 by default).
    Below these 5 rows, it should then produce 20 similar rows with for the 2nd row on the "outbound" tab, then 10 rows for the 3rd row etc..
    Number of rows in the "outbound" tab can vary, is not a fixed number of rows, so that should be taken into account when writing the VBA code.

    Hopefully this is making some sense to you ;-)

    I sincerely hope you can help me with the above!!

    Thanks in advance,
    PeterExample file.xlsx

  2. #2
    Registered User
    Join Date
    10-26-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: Automatically create and fill rows based on a given quantity

    I think it will solve your problebExample file.xlsm

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

    Re: Automatically create and fill rows based on a given quantity

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    08-10-2006
    Location
    The Netherlands
    MS-Off Ver
    Office for Mac 2016; MS Office 2016 for Windows
    Posts
    110

    Re: Automatically create and fill rows based on a given quantity

    Hi Piyushanand,

    This works perfectly! Thanks a million!

    Regards,
    Peter

+ 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