AW: Makro wiederholung
07.02.2025 08:31:43
Ulf
Hi
nochmal mit Parameter
Option Explicit
Sub zeilenKopieren()
Dim i As Long
Dim rg As Range
Dim WieOft As Long
Dim lngStartZeile As Long
Dim lngEndZeile As Long
'Zeile
lngStartZeile = 4
lngEndZeile = 5
'Hier ändern
WieOft = 2
'
With Worksheets("Tabelle1")
'Wenn du die Anzahl beschränken willst
'eine
' .Range("4").Copy
'drei
' .Range("4:6").Copy
'
For i = 1 To WieOft
.Range(lngStartZeile & ":" & lngEndZeile).Copy
Set rg = .Range(.Cells(lngEndZeile, 1).Offset(1).Row & ":" & .Cells(lngEndZeile, 1).Offset(1).Row + 1)
.Range(rg.Address).Insert Shift:=xlShiftDown
'.Range(.Cells(Rows.Count, 1).End(xlUp).Offset(1).Row & ":" & .Cells(Rows.Count, 1).End(xlUp).Offset(1).Row + 1).PasteSpecial
Next
End With
Application.CutCopyMode = False
End Sub
hth
Ulf