Datum minus Monate VBA
20.11.2005 18:07:59
Wolfgang
was muss ich machen damit edate geht.
Es kommt die Meldung Datenfeld
Sub test1()
Dim edate As Date
For i = 2 To Range("A65536").End(xlUp).Row
If Cells(i, 3) < Cells(i, 2) And (Cells(i, 3) > Cells(i, 1)) Then
Cells(i, 6).Value = "geändert zum" & Cells(i, 3)
ElseIf Cells(i, 3) < Cells(i, 2) And (Cells(i, 3) > Cells(i, 1) And (Cells(i, 5) = "Month")) Then
Cells(i, 6).Value = edate(Cells(i, 2), -Cells(i, 4))
ElseIf Cells(i, 6) = "" And (Cells(i, 5) = "Week") Then
Cells(i, 6).Value = Cells(i, 2) - Cells(i, 4) * 7
End If
Next
End Sub