+ Reply to Thread
Results 1 to 6 of 6

Copy range # of times based on cell value.

  1. #1
    Forum Contributor
    Join Date
    06-24-2004
    MS-Off Ver
    Excel 2013 Pro Plus
    Posts
    122

    Copy range # of times based on cell value.

    Hello friends, hope all is well!

    Please help me, I want and based on the numbers on column F, want to copy the ranges from A:E to another sheet.
    i.e. if the cell in column F equals 4, then the range is copied 4 times and placed on top of eachother.

    The sheet ‘desired results’ will show what is needed.

    Thank you very much in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Copy range # of times based on cell value.

    I want and based on the numbers on column F
    You mean column G

    ...want to copy the ranges from A:E to another sheet.
    You mean from A:F

    Please Login or Register  to view this content.
    Last edited by Special-K; 01-24-2018 at 06:58 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Copy range # of times based on cell value.

    In the attached file, I have put zero in K4 (important) and this formula in K5 of the MANPOWER sheet:

    =IF(G5="","-",G5+K4)

    This can then be copied down as far as you like. This gives a cumulative count of the number of records that you need.

    Then I have used this formula in cell A2 of the Desired sheet:

    =IF(ROWS($1:1)>MAX(MANPOWER!$K:$K),"",IFERROR(INDEX(MANPOWER!$A:$G,MATCH(ROWS($1:1)-1,MANPOWER!$K:$K)+1,MATCH(A$1,MANPOWER!$A$4:$G$4,0)),""))

    which can be copied across and down as required. Note that I have corrected the spelling in cell F1. You can delete columns H to O if you are happy that the formulae produce the same results.

    Hope this helps.

    Pete
    Attached Files Attached Files

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Copy range # of times based on cell value.

    Please Login or Register  to view this content.
    Last edited by bakerman2; 01-24-2018 at 07:08 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Contributor
    Join Date
    06-24-2004
    MS-Off Ver
    Excel 2013 Pro Plus
    Posts
    122

    Re: Copy range # of times based on cell value.

    I salute and am grateful to you all, great effort!

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Copy range # of times based on cell value.

    You're welcome and thanks for rep+.

+ 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. [SOLVED] Copy Column x number of times based on cell value?
    By nobodyukno in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-09-2017, 11:20 AM
  2. Copy and Paste Cell X number of times based on Adjacent Cell
    By GabeGabe in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-07-2016, 11:40 AM
  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 Range X times Based on User Entered #
    By drs2991 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-02-2015, 09:36 AM
  5. Copy Name with description in a cell as many times descriptions come in a range
    By brajpalshishodia in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2012, 12:31 PM
  6. Copy Worksheet X Times Based on Cell Value
    By PY_ in forum Excel General
    Replies: 2
    Last Post: 01-04-2011, 04:10 PM
  7. copy sheet a # of times based on cell value
    By nuver in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2005, 03:34 PM

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