kann mir jemand einen tipp geben wo mein code streikt?
strSearch = "Testjahr" ' Suchbegriff in Überschrift
lngRow = 30 ' Zeile in der nach "Suchbegriff" gesucht wird
strmarkValue1 = "1990"
Call einfaerben3(strSearch, lngRow, strmarkValue1)
Sub einfaerben3(ByVal strSearch As String, ByVal lngSrchRow As Long, ByVal strmarkValue1 As _
Variant)
Dim rng As Range, rngCol As Range, c As Range
Set rng = Rows(lngSrchRow).Find(What:=strSearch, _
LookAt:=xlWhole, _
LookIn:=xlValues, _
MatchCase:=False)
If Not rng Is Nothing Then
On Error Resume Next
Set rngCol = rng.EntireColumn.SpecialCells(xlCellTypeConstants, xlTextValues)
On Error GoTo 0
If Not rngCol Is Nothing Then
For Each c In rngCol
Select Case c.Value
Case Is "1990"
c.Interior.ColorIndex = 4
Case strmarkValue1
c.Interior.ColorIndex = 2
Case strSearch
c.Interior.ColorIndex = 15
Case Else
' do nothing
End Select
Next
End If
End If
Set rng = Nothing
Set rngCol = Nothing
Set c = Nothing
End Sub
danke rudi