+ Reply to Thread
Results 1 to 8 of 8

Make Excel copy rows a certain number of times

  1. #1
    Registered User
    Join Date
    10-31-2018
    Location
    Baltimore, Maryland
    MS-Off Ver
    Current
    Posts
    4

    Make Excel copy rows a certain number of times

    This question is for the purpose of creating stickers for our inventory- my bosses are insisting on creating exact amounts of stickers rather than in multiples of 10, and currently it is super time consuming.
    Is there a way I could have two columns - one containing SKUs, other containing number of rows needed, and have it make a new sheet with that many rows?

    As an example, sku column says item_1 , and Number column says 6 , and the result of the function/mmacro would be that a sheet now exists with 6 rows each starting with the SKU item_1?
    I could use a vlookup to get the rest of required information in, but if there is a way to fix above problem, it would be a massive time saver!

    Thanks so much,
    Phil

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Make Excel copy rows a certain number of times

    Yep.

    =IFERROR(INDEX($A$2:$A$4,MATCH(0,INDEX(--(COUNTIF($D$1:D1,$A$2:$A$4)=$B$2:$B$4),0),0)),"")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    10-31-2018
    Location
    Baltimore, Maryland
    MS-Off Ver
    Current
    Posts
    4

    Re: Make Excel copy rows a certain number of times

    Glenn!
    Thanks so much, this is a lifesaver!
    God bless,
    Phil

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Make Excel copy rows a certain number of times

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  5. #5
    Registered User
    Join Date
    10-31-2018
    Location
    Baltimore, Maryland
    MS-Off Ver
    Current
    Posts
    4

    Re: Make Excel copy rows a certain number of times

    will do,
    one final question with it!at any given time I may have up to 300-400 skus to reference- I tried changing the formula to have the A and B reference A$2:A$300 and same for Bs,
    but that doesn't seem to work - what else do I need to change to make it do that? If possible....

    Trying to learn the logic by looking at what you wrote, but I guess I have lots to learn in excel

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Make Excel copy rows a certain number of times

    COUNTIF($D$1:D1... needs to reference the cell ABOVE the one the formula starts in. What do you mean by "doesn't work"?

  7. #7
    Registered User
    Join Date
    10-31-2018
    Location
    Baltimore, Maryland
    MS-Off Ver
    Current
    Posts
    4

    Re: Make Excel copy rows a certain number of times

    It seemed like it wasn't working, but now I see it shows as calculating - which makes sense I think- i'm trying to make it produce 1191 rows, which means each time excel is looking back through the previous rows as it goes down.
    It just finished and looks like it worked fine, really huge thanks for your help... For future reference would it work faster if I broke it into a few chunks?

    Thanks!

    God bless!

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Make Excel copy rows a certain number of times

    Quote Originally Posted by philglobal View Post
    For future reference would it work faster if I broke it into a few chunks?
    If you're really pushing the row numbers... then yes, almost certainly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to copy multiple excel rows X amount of times
    By cbroadhurst in forum Excel General
    Replies: 9
    Last Post: 04-21-2017, 05:00 PM
  2. [SOLVED] Code to gather data from multiple rows in one row and copy it a number of times
    By terryhenderson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2017, 04:14 PM
  3. [SOLVED] Copy rows/range and paste n number of times based on last used cell in Column A
    By skonduru in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2016, 02:30 PM
  4. Copy rows x number of times into a new sheet
    By jeni_16 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-17-2013, 03:52 AM
  5. Replies: 0
    Last Post: 05-18-2012, 11:18 PM
  6. Copy and insert rows n number of times + operations on data
    By rogerissimo in forum Excel General
    Replies: 2
    Last Post: 10-08-2010, 12:47 PM
  7. Copy and insert rows n number of times + operations on data
    By rogerissimo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2010, 11:35 AM

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