AW: Zeilen gleicher Datum und Uhrzeit löschen
12.04.2017 16:14:50
Jonas
Hallo Dagi,
tut mir leid hat etwas Länger gedauert musste noch was erledigen.
Hier mein Vorschlag:
Sub LöschenUndKopieren()
Dim i As Integer
Dim lr As Long
Dim Wert1 As Double
Dim Wert2 As Double
lr = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To lr
If Cells(i, 1).Value = Cells(i + 1, 1).Value Then
Cells(i + 1, 1).Delete Shift:=xlUp
End If
Wert1 = Application.WorksheetFunction.Round(Cells(i + 1, 1).Value, 3) 'Untere zelle
Wert2 = Application.WorksheetFunction.Round(Cells(i, 1).Value + 1 / 24, 3) 'obere Zelle
If Wert1 > Wert2 Then
Range(Cells(i + 1, 1), Cells(i + 1, 6)).Select
Selection.Insert Shift:=xlDown
Range(Cells(i + 1, 1), Cells(i + 1, 6)).Value = Range(Cells(i, 1), Cells(i, 6)).Value
Cells(i + 1, 1).Value = Cells(i + 1, 1).Value + 1 / 24
End If
Cells(2, 7) = i + 1
Next i
End Sub
Bei mir hats geklappt aber mach die lieber vorher ne Kopie, man kann nie wissen.
Gruß Jonas