Habe in mehreren Tabellenblättern in Spalte A4 bis A52 ein fortl.Datum stehen.
Wenn ich über eine Inputbox das Datum suche, findet es kein Datum obwohl vorhanden.Wo liegt der Fehler.
Bitte um Hilfe.
Danke
Sub MultiSuche()
Dim Sh As Worksheet
Dim GZelle As Range
Dim FStelle As String
Dim SBegriff As Date
Dim bSchalter As Boolean
bSchalter = False
SBegriff = Date
SBegriff = InputBox("Bitte als Suchbegriff ein Datum eingeben:", "Datums-Suche", SBegriff)
For Each Sh In Worksheets
Sh.Activate
Set GZelle = Sh.Range("A4:A52").Find(SBegriff)
If Not GZelle Is Nothing Then
FStelle = GZelle.Address
Do
GZelle.Activate
If MsgBox("Weiter suchen ?", vbYesNo + vbQuestion) = vbNo Then Exit Sub
Set GZelle = Cells.FindNext(After:=ActiveCell)
If GZelle.Address = FStelle Then Exit Do
Loop
Else
If bSchalter = False Then
MsgBox "DAS GESUCHTE DATUM WURDE NICHT GEFUNDEN SA. & SO. NICHT Eingetragen.", 64, _
"Das Datum ist nicht vorhanden."
bSchalter = True
End If
End If
Next Sh
End Sub