Option
Explicit
Sub
kopieren_spezial()
Dim
letztezeile
As
Long
Dim
startwert
As
Long
, endwert
As
Long
Dim
i
As
Long
, j
As
Long
Dim
starttime
As
Date
, endtime
As
Date
With
Worksheets(
"Tabellenblatt2"
)
starttime = .Range(
"D1"
).Value
endtime = .Range(
"F1"
).Value
End
With
With
Worksheets(
"Tabellenblatt1"
)
letztezeile = .Cells(Rows.Count, 34).
End
(xlUp).Row
For
i = 25
To
letztezeile
If
.Range(
"AH"
& i).Value > starttime
Then
startwert = i - 1
Exit
For
End
If
Next
i
For
j = 25
To
letztezeile
If
Range(
"AH"
& j).Value > endtime
Then
endwert = i
Exit
For
End
If
Next
j
.Range(Rows(startwert), Rows(endwert)).Copy
Worksheets(
"Tabellenblatt2"
).Paste Destination:=Worksheets(
"Tabellenblatt2"
).Rows(3)
End
With
End
Sub
mfg, GraFri