View Single Post
 
Old 12-26-2021, 04:25 AM
rollis13's Avatar
rollis13 rollis13 is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Jan 2021
Location: Cordenons
Posts: 142
rollis13 will become famous soon enough
Default

Hi to all.
With these modifications you will go a step ahead:
Code:
Option Explicit
Sub Colorsquiz()
    Dim i      As Long
    Dim Rng    As Range
    Dim Para   As Paragraph
    Set Rng = ActiveDocument.Range
    For i = 1 To Rng.Paragraphs.Count
        Set Para = Rng.Paragraphs(i)
        Para.Range.Select
        Select Case Para.Range.ParagraphFormat.Shading.BackgroundPatternColor
            Case RGB(0, 174, 239)
                Para.Range.ParagraphFormat.Shading.BackgroundPatternColor = RGB(236, 0, 140)
            Case RGB(255, 244, 253)
                Para.Range.ParagraphFormat.Shading.BackgroundPatternColor = RGB(253, 233, 241)
        End Select
        'For Font
        If Para.Range.Font.Color = RGB(0, 174, 239) Then Para.Range.Font.Color = RGB(236, 0, 140)
    Next i
End Sub
Reply With Quote