Dit is de code die ik nu al erin staan heb:
Sub RijKopierenInvoegen()
'Updateby Extendoffice
ActiveSheet.Unprotect "Depypere1A"
Dim xCount As Integer
LableNumber:
xCount = Application.InputBox("Number of Rows", "Kutools for Excel", , , , , , 1)
If xCount < 1 Then
MsgBox "the entered number of rows is error, please enter again", vbInformation, "Kutools for Excel"
GoTo LableNumber
End If
ActiveCell.EntireRow.Copy
Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(xCount, 0)).EntireRow.Insert Shift:=xlDown
Application.CutCopyMode = False
ActiveSheet.Protect "Depypere1A", DrawingObjects:=True, Contents:=True, _
Scenarios:=False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=False, AllowInsertingRows:=False, _
AllowInsertingHyperlinks:=False, AllowDeletingColumns:=False, AllowDeletingRows:=False, _
AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=False
End Sub
In bijlage het bestand: