# Vba code to just find red font color text in powerpoint



## shoun2502 (Sep 17, 2019)

Dear Team, 

I am using the mentioned vba code to find text in font color red in powerpoint . The below mentioned code i was using to find red color font text in ms word. 


```
Sub newred()
    Selection.Find.ClearFormatting
    Selection.Find.Font.Color = wdColorRed
    With Selection.Find
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
End Sub
```

Further,  I need to find the red color font text in each slide of my presentation. 

I could not get the subroutine to successful run in the powerpoint. 

Please help me with that. 

Regards


----------



## shoun2502 (Sep 17, 2019)

I have written a subroutine as mentioned below but could not get the desired result


```
Sub findred()
    Dim aslide As Slide
    Dim ashape As Shape
    For Each aslide In ActivePresentation.Slides
        For Each ashape In aslide.Shapes
            If ashape.Type = msoTextBox Then
                If ashape.TextFrame2.HasText Then
                    If ashape.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(255, 0, 0) Then
                    End If
                     End If
                      End If
                              Next ashape
    Next aslide
End Sub
```


----------

