AW: Suchergebnis > Text markieren
25.07.2018 12:04:43
KlausF
Hallo Markus,
folgendes Makro färbt den Teil-Suchbegriff in der Zelle rot
(die Auswahl ist vorher selektiert):
Sub WortEinfaerben()
Dim rngZelle As Range
Dim intPosition As Integer
Dim strWort As String
strWort = InputBox("Welches Wort soll eingefärbt werden!", "Wort einfärben")
If strWort "False" Then
For Each rngZelle In Selection.Cells
intPosition = InStr(1, rngZelle, strWort)
If intPosition 0 Then
With rngZelle.Characters(intPosition, Len(strWort))
.Font.Color = RGB(255, 0, 0)
End With
End If
Next
End If
End Sub
Kann man denke ich leicht umstricken ...
Gruß
Klaus