Repeat row x times
Closed
Richard
-
Feb 22, 2017 at 02:57 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Mar 1, 2017 at 03:55 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Mar 1, 2017 at 03:55 AM
Related:
- How to duplicate rows in excel x times
- Number to words in excel - Guide
- How to take screenshot in excel - Guide
- You have guessed too many times ✓ - WhatsApp Forum
- How to change author in excel - Guide
- How to change time in whatsapp - Guide
8 responses
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Feb 23, 2017 at 02:54 AM
Feb 23, 2017 at 02:54 AM
Hello Richard,
Perhaps the following code, assigned to a button, may do the task for you:-
I've prepared a little sample at the following link for you to play with:-
https://www.dropbox.com/s/edpbkfor4j9vlay/Copy%20x%20number%20of%20rows%20to%20sht%202.xlsm?dl=0
Click on the "RUN" button to see it work.
I hope that this helps.
Cheerio,
vcoolio.
Perhaps the following code, assigned to a button, may do the task for you:-
Sub CopyRows() Dim r As Range For Each r In Range("F2", Range("F" & Rows.Count).End(xlUp)) Sheet2.Cells(Rows.Count, 1).End(xlUp)(2).Resize(r.Value, 5) = r.Offset(, -5).Resize(1, 5).Value Next r End Sub
I've prepared a little sample at the following link for you to play with:-
https://www.dropbox.com/s/edpbkfor4j9vlay/Copy%20x%20number%20of%20rows%20to%20sht%202.xlsm?dl=0
Click on the "RUN" button to see it work.
I hope that this helps.
Cheerio,
vcoolio.