Teo
Teo

Reputation: 11

How to find font and replace with highlight

I have a question regarding Application.Findformat.font I am trying to find font Winding2 and highlight yellow. I was able to put something together to find and delete windings. The next step is to highlight wherever a winding exists. Your help is greatly appreciated!

Cells.Select
    With Application.FindFormat.Font
        .Name = "Wingdings 2"
        .Subscript = False
        .TintAndShade = 0
        .ThemeFont = xlThemeFontNone
    End With
       Selection.Replace What:="P", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=True, _
        ReplaceFormat:=False
End Sub

Upvotes: 1

Views: 224

Answers (1)

Sivaprasath Vadivel
Sivaprasath Vadivel

Reputation: 541

   With Application.FindFormat.Font
        .Name = "Wingdings 2"
        .Subscript = False
        .TintAndShade = 0
        .ThemeFont = xlThemeFontNone
    End With
    With Application.ReplaceFormat.Interior
        .PatternColorIndex = xlAutomatic
        .Color = 65535
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    With application.replaceformat.font
        .Name="Arial"
     End With
    Cells.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder:= _
        xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True

try this you could have got this by recording macro in your excel.

Upvotes: 1

Related Questions