Hallo, wie schon in der überschrift beschrieben. Ich konvertiere in meinem Programm das Datum auf Englisches Format und überprüfe dann ob ich ein korrektes Datum eingegeben habe. Lustigerweise findet er den oben erwähnten Interval nicht obwohl er korrekt formatiert. Bitte um Hilfe..
Sub StatistischeBerechnung()
Dim LetzteZeile As Integer
LetzteZeile = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Dim IntervalA As String
Dim IntervalB As String
IntervalA = Range("J2").Value
IntervalB = Range("J4").Value
IntervalA = Format(IntervalA, "mm\/dd\/yyyy")
IntervalB = Format(IntervalB, "mm\/dd\/yyyy")
MsgBox (IntervalA)
MsgBox (IntervalB)
Dim FindDateIntervalA As Range
Dim FindDateIntervalB As Range
Set FindDateIntervalA = ActiveSheet.Range(Cells(1, 1), Cells(LetzteZeile, 1)).Find(What:=IntervalA)
Set FindDateIntervalB = ActiveSheet.Range(Cells(1, 1), Cells(LetzteZeile, 1)).Find(What:=IntervalB)
DatumVorhanden FindDateIntervalA, FindDateIntervalB
Dim i As Date
For i = IntervalA To IntervalB
Next i
End Sub
Private Sub DatumVorhanden(FindDateIntervalA As Range, FindDateIntervalB As Range)
If FindDateIntervalA Is Nothing Then
MsgBox ("Datum IntervalA nicht gefunden")
Else
End If
If FindDateIntervalB Is Nothing Then
MsgBox ("Datum IntervalB nicht gefunden")
Else
End If
End Sub
|