Gruppe
Allgemein
Problem
Aus Spalte A soll das höchste Datum ausgelesen und alle Datumseintragungen in Spalte B geschrieben werden.
StandardModule: basMain
Sub LastDate()
Dim iRow As Integer, iRowL As Integer
Dim iTarget As Integer
Dim dat As Date
iRowL = Cells(Rows.Count, 1).End(xlUp).Row
For iRow = 1 To iRowL
If IsDate(Cells(iRow, 1)) Then
If Cells(iRow, 1).Value > dat Then
dat = Cells(iRow, 1).Value
End If
iTarget = iTarget + 1
Cells(iTarget, 2) = Cells(iRow, 1)
End If
Next iRow
MsgBox Format(dat, "dd.mm.yy")
End Sub