Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Anzeige
Inhaltsverzeichnis

Datum minus Monate VBA

Forumthread: Datum minus Monate VBA

Datum minus Monate VBA
20.11.2005 19:07:59
Wolfgang
Hallo zusammen,
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

Anzeige

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Datum minus Monate VBA
20.11.2005 19:45:36
Nepumuk
Hallo Wolfgang,
schau dir mal die Hilfe zur DateAdd - Funktion, DateDiff - Funktion und DatePart - Funktion an.
Gruß
Nepumuk

AW: Datum minus Monate VBA
20.11.2005 19:59:24
Wolfgang
Hallo das problem ist das Cells(i, 2)und Cells(i, 4)nicht als datum erkannt werden.
Gebe ich es z.B. so ein geht es.
ActiveCell.FormulaR1C1 = "=EDATUM(RC[-4],-RC[-2])"
Anzeige
AW: Datum minus Monate VBA
20.11.2005 22:18:50
Nepumuk
Hallo Wolfgang,
kannst du mal eine Mustermappe auf den Server laden? Ich kann das per Ferndiagnose nicht nachvollziehen.
Gruß
Nepumuk

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige