By: Rubayed Razib Suprov

In reply to Prasanth.

Greetings Prasanth,
Thanks a lot for the question you asked. Below I provide a code using which you can add rows in another worksheet. When you run the code, then you will see that the values stored in the C3:D3 insert in another worksheet. The values are now repeated according to the value mentioned in the cell E3

Sub InsertRows()
Dim Qty As Integer
Dim sourceSheet As Worksheet
Dim destinationSheet As Worksheet
Dim lastRow As Long
Dim pasteRange As Range

Set sourceSheet = ThisWorkbook.Worksheets("Sheet1") ' Replace "Sheet1" with the actual name of the source sheet
Set destinationSheet = ThisWorkbook.Worksheets("Sheet2") ' Replace "Sheet2" with the actual name of the destination sheet

Qty = sourceSheet.Range("E3").Value

lastRow = destinationSheet.Cells(destinationSheet.Rows.Count, "B").End(xlUp).Row

Set pasteRange = destinationSheet.Cells(lastRow + 1, "B").Resize(Qty, 2)

pasteRange.Insert Shift:=xlDown

destinationSheet.Cells(lastRow + 1, "B").Resize(Qty, 2).Value = sourceSheet.Range("C3:D3").Value

Application.CutCopyMode = False
destinationSheet.Select ' Optional: Select the destination sheet after inserting rows
End Sub