Range Find
05.02.2022 15:33:30
roman
Ich habe ein Problem bezüglich Range Find methode.
In Spalte B habe ich datum drin zwischen B12 und B100.
Mein Code:
Dim monat As String
Dim datum As Date
Dim strdatum As String
Dim bereich As Range
Dim strbereich As String
Dim ergebnis As String
datum = EingabeFormular.txt_Datum.Value
strdatum = datum
monat = MonthName(Month(datum))
Worksheets(monat).Activate
last = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
strbereich = "B12:B" & last
Set bereich = Range(strbereich).Find(what:=strdatum, LookIn:=xlValues, Lookat:=xlWhole)
If Not bereich Is Nothing Then
ActiveSheet.Cells(last, 2).Value = bereich.Address
End If
Ich kriege immer bereich NothingWo liegt mein problem?