AW: Kappes ? Berg zum Ochs' :-)
Gerd
Hallo!
Sub Start_Suche()
Dim x As Variant, intCt as integer
x = Wochentag_in_Datum("Mo", ActiveSheet.Range(ActiveSheet.Cells(1, 1), ActiveSheet.Cells(1, ActiveSheet.Columns.Count).End(xlToLeft)))
For intCt = LBound(x) To UBound(x)
MsgBox "Spalte: " & x(intCt)
Next
End Sub
Public Function Wochentag_in_Datum(ByVal Wochentag As String, Bereich As Range) As Variant
Dim arr() As Variant
Dim rngCell As Range
Dim rngTag As Range
Dim strErster As String
Dim Spalte As Variant
arr() = Bereich.Value
For Each rngCell In Bereich
rngCell.Value = rngCell.Text
Next
Set rngTag = Bereich.Find("Mo", , xlValues, xlWhole)
strErster = rngTag.Address
Do
Spalte = Spalte & "," & rngTag.Column
Set rngTag = Bereich.FindNext(rngTag)
Loop While Not rngTag.Address = strErster
Bereich = arr
Wochentag_in_Datum = Split(Mid(Spalte, 2), ",")
End Function
Gruß Gerd