Bitte um Hilfe von Rudi Maintaire 2.0
05.12.2016 08:57:53
Rudi
Rudi Maintaire hatte mir mal mit folgendem Makro geholfen.
Dabei bräuchte ich mal wieder Hilfe, da ich beim weiter bearbeiten meiner Tabelle nun auf ein Problem damit gestoßen bin.
Vlt könnte mir Rudi Maintaire dabei nochmals helfen, wenn jemand anders weiter weiß nehmen ich natürlich auch von Ihm gerne Hilfe an.
Sub Pläne_markieren()
Dim rngMatch As Range, rngC As Range, rngA As Range, strMatch
Dim lngCol As Long, i As Integer
Application.ScreenUpdating = False
With Tabelle2
Set rngMatch = .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
End With
For Each rngA In Tabelle1.UsedRange.Cells
rngA.Font.Color = 0
For Each rngC In rngMatch
lngCol = rngC.Font.Color
For i = 1 To Len(rngA) - Len(rngC) + 1
strMatch = Mid(rngA, i, Len(rngC))
Debug.Print strMatch
If strMatch = rngC Then
With rngA.Characters(i, Len(rngC)).Font
.Color = lngCol
.Bold = True
.Italic = True
End With
End If
Next i
Next rngC
Next rngA
End Sub
Kurz zum Makro, es formatiert alle gefundenen Texte aus Tabelle2 in Tabelle1.
Mein Problem ist nun das es auch alle anderen Texte in Tabelle1 automatisch auf schwarz setzt.
Da ich diese aber mit einem anderen Makro vorher bereits bearbeiten lasse, wäre es notwendig das dieses Makro die restlichen Text bei Ihrer formatierung belässt.
Danke schon im voraus für eure Hilfe!
mfg Blue Bird