Ich brauche ein Makro, welches zwei Uhrzeiten miteinander vergleicht und wenn die Zeiten näher als 30 min zusammenliegen die Zeile automatisch in ein extra Tabellenblatt kopiert wird.
Bitte helft mir, ich blick nicht mehr durch!
Danke!!
Sub Kopieren()
Dim lngCount&, lngCount2&
lngCount = 2
With Worksheets("NameKopie") 'Namen anpassen, da wird hinkopiert
lngCount2 = .Cells(Rows.Count, 1).End(xlUp).Row + 1 'freie Zeile
While Not IsEmpty(Cells(lngCount, 1))
If (Cells(lngCount, 7).Value - Cells(lngCount, 1).Value) * 3600 < 75.01 Then
Rows(lngCount).Copy Destination:=.Cells(lngCount2, 1)
lngCount2 = lngCount2 + 1
End If
lngCount = lngCount + 1
Wend
End With
Application.CutCopyMode = False
End Sub