Excel - Repeat Last row into N number of times
Closed
Abu.hamna
TrowaD
- Posts
- 1
- Registration date
- Tuesday February 28, 2017
- Status
- Member
- Last seen
- February 28, 2017
TrowaD
- Posts
- 2880
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- May 2, 2022
Related:
- Excel - Repeat Last row into N number of times
- Excel repeat each row n times ✓ - Forum - Excel
- Repeat rows in Excel: based on cell value, VBA - Guide
- Excel - Repeat rows to a specific number of times ✓ - Forum - Excel
- Copy row and insert n times ✓ - Forum - Office Software
- Repeat row x times - Forum - Excel
1 reply
TrowaD
Feb 28, 2017 at 11:48 AM
- Posts
- 2880
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- May 2, 2022
Feb 28, 2017 at 11:48 AM
Hi Abu,
You didn't mentioned where the number N can be found, so I let Excel ask you.
Here is the code:
Best regards,
Trowa
You didn't mentioned where the number N can be found, so I let Excel ask you.
Here is the code:
Sub RunMe() Dim x, N As Integer N = InputBox("How many times do you want to repeat the last row?:") x = Range("A1").End(xlDown).Row Do Until N = 0 Rows(x).Copy Range("A" & Rows.Count).End(xlUp).Offset(1, 0) N = N - 1 Loop End Sub
Best regards,
Trowa