+ Reply to Thread
Results 1 to 6 of 6

macro to repeat all rows cell acording to specific value

  1. #1
    Registered User
    Join Date
    10-05-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2011
    Posts
    13

    macro to repeat all rows cell acording to specific value

    Hey,

    Can you please tell me a formula or macro to repeat the contents of a row depending on a cell value.

    I need the whole row to repeat as many times as the "Qty" Column.

    for eg. - if qty is 1 then the row appears only 1 time
    if qty is 3 then the same row repeats three times.
    sample.xlsx

  2. #2
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: macro to repeat all rows cell acording to specific value

    Hi,

    See the attached file. It is working fine in my system. Let us know how it works.

    If it is working fine then mark the thread as SOLVED.


    Regards

    taps
    Attached Files Attached Files

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: macro to repeat all rows cell acording to specific value

    Hello ispyhope,

    Give this a try. Should produce 101 rows which is the sum of your Qty.

    Please Login or Register  to view this content.
    Last edited by mike7952; 10-05-2012 at 08:16 AM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Registered User
    Join Date
    10-05-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: macro to repeat all rows cell acording to specific value

    @taps and mike - First of all thank you so much for the solutions.

    In both cases I need to add many more rows of data. I had only sent in a sample file. Total no. of rows - 1141. In that case what do I need to do?
    @taps - I tried adding all the new rows and clicking on the Run Macro button, but that appears to be a picture.
    @mike - Erro says "Subscript out of range"

    Thanks again for your help. Would appreciate the response to this as well.

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: macro to repeat all rows cell acording to specific value

    Whats the name of the sheet that your data is on? If its not sheet1 then change this

    Please Login or Register  to view this content.
    Last edited by mike7952; 10-05-2012 at 08:15 AM.

  6. #6
    Registered User
    Join Date
    10-05-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: macro to repeat all rows cell acording to specific value

    Awesome.. Thank you

+ 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