Eine Familie von Microsoft-Tabellenkalkulationsprogrammen mit Tools zum Analysieren, Darstellen und Vermitteln von Daten.
Hallo Steffi,
probiers mal mit Schraffur:
Sub FindenFaerben()
Dim Such As Variant
Dim arrSuch As Variant
Dim c As Range, rngC As Range
Dim FirstAddress As String
Such = Application.InputBox("Gib hier deinen Suchbegriff ein" _
& Chr(10) & " und semikolongetrennt" & Chr(10) & _
"eine 0 für Suche in ganzer Zelle" _
& Chr(10) & "eine 1 für Suche in Teil der Zelle", _
"Suchbegriff", Type:=3)
arrSuch = Split(Such, ";")
Application.ScreenUpdating = False
With ActiveSheet
With .UsedRange.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Set c = .UsedRange.Find(arrSuch(0), LookIn:=xlValues, _
lookat:=IIf(arrSuch(1) = 0, xlWhole, xlPart))
If Not c Is Nothing Then
FirstAddress = c.Address
Do
With c.Interior
.Pattern = xlLightUp
.PatternColorIndex = xlAutomatic
.ColorIndex = xlAutomatic
End With
Set c = .UsedRange.FindNext(c)
Loop While Not c Is Nothing And c.Address <> FirstAddress
End If
End With
Application.ScreenUpdating = True
End Sub
Mit freundlichen Grüßen
Claus