Supercharge your PowerPoint productivity with
Supercharge your PPT Productivity with PPTools - Click here to learn more.

Proud member of


Image Export converts PowerPoint slides to high-quality images.

PPT2HTML exports HTML even from PowerPoint 2010 and 2013, gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

Resize your presentations quickly and without distortion

Language Selector switches the text in your presentation from one language to another

FixLinks prevents broken links when you distribute PowerPoint presentations

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

Change one text color to another


You have lots of text in lots of slides. Some of it has been set to a color that you now need to change. This will help.


Option Explicit

Sub ChangeTextColors()

    Dim oSl As Slide
    Dim oSh As Shape
    Dim lCol As Long
    Dim lRow As Long
    Dim x As Long

    Dim lOldColor As Long
    Dim lNewColor As Long

    lOldColor = RGB(100, 200, 100)
    lNewColor = RGB(200, 100, 200)

    For Each oSl In ActivePresentation.Slides
        For Each oSh In oSl.Shapes

            If oSh.HasTextFrame Then
                If oSh.TextFrame.HasText Then
                    Call ChangeTextRange(oSh.TextFrame, lOldColor, lNewColor)
                End If
            End If

            If oSh.HasTable Then
                With oSh.Table
                    For lCol = 1 To .Columns.Count
                        For lRow = 1 To .Rows.Count
                            Call ChangeTextRange(.Cell(lRow, lCol).Shape.TextFrame, lOldColor, lNewColor)
                End With
            End If

' this part is commented out because PPT 's buggy and ... sorry ... haven't quite figured it out yet:
'            If oSh.HasSmartArt Then
'                With oSh.SmartArt
'                    For x = 1 To .Nodes.Count
'                        Call ChangeTextRange(.Nodes(x).TextFrame2, lOldColor, lNewColor)
'                    Next
'                End With
'            End If

            If oSh.HasChart Then
                ' You're on your own, my friend
            End If


End Sub

Sub ChangeTextRange(oTextFrame As Object, lOldColor As Long, lNewColor As Long)

    Dim x As Long

    With oTextFrame.TextRange
        For x = 1 To .Runs.Count
            If .Runs(x).Font.Color.RGB = lOldColor Then
                .Runs(x).Font.Color.RGB = lNewColor
            End If
    End With

End Sub

See How do I use VBA code in PowerPoint? to learn how to use this example code.

Did this solve your problem? If so, please consider supporting the PPT FAQ with a small PayPal donation.
Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2022 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.

Supercharge your PPT Productivity with PPTools

content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Change one text color to another
Last update 19 August, 2015
Created: 19 August, 2015