Copy and insert rows and number of times
Solved/Closed
Related:
- How to duplicate rows in excel x times
- Insert copied cells multiple times - Best answers
- Excel duplicate row x times - Best answers
- Number to words in excel - Guide
- How to take screenshot in excel - Guide
- You have guessed too many times ✓ - WhatsApp Forum
- How to change time in whatsapp - Guide
- How to change author in excel - Guide
8 responses
aquarelle
Posts
7140
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
March 25, 2024
491
Updated on Jan 1, 2019 at 10:07 AM
Updated on Jan 1, 2019 at 10:07 AM
Hi,
Look at this thread or try this macro:
Best regards
Look at this thread or try this macro:
Sub InsertRows()
Dim I As Long, J As Integer, Nb As Integer
For I = Range("A65536").End(xlUp).Row To 2 Step -1
Nb = 4
For J = 1 To Nb - 1
Rows(I + J).Insert xlDown
Rows(I).Copy
Rows(I + J).PasteSpecial '
Next
Next
Range("A1").Select
Application.CutCopyMode = False
End Sub
Best regards
Oct 13, 2010 at 01:09 PM
Help please?
Thank you.
Jun 10, 2014 at 08:54 AM
Sub Copy_Row()
'Written by Barrie Davidson
Dim NRow As Integer
Dim CurrentRow As Integer
Dim SheetName As String
Dim Datasheet As String
Datasheet = ActiveSheet.Name
ActiveWorkbook.Sheets.Add after:=Sheets(Datasheet)
SheetName = ActiveSheet.Name
Sheets(Datasheet).Select
Range("A1").Select
Do Until Selection.Value = ""
CurrentRow = Selection.Row
NRow = InputBox("Current row selected is " & CurrentRow & Chr(13) & _
"Enter Number of Copies Required")
Selection.EntireRow.Copy
Sheets(SheetName).Select
ActiveCell.Range("A1:A" & NRow).EntireRow.Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.Range("A" & NRow).Offset(1, 0).Select
Sheets(Datasheet).Select
ActiveCell.Offset(1, 0).Select
Loop
End Sub