0

シェーディングの色に関係なく、Word でシェーディングされたすべてのセルを検索し、一貫性を保つために、シェーディングの色を 1 つの色合いに変更するのに役立つマクロを考え出すための助けを探しています。これまでの私のすべての調査から、実際にマクロに色情報を入れないとできないようです。どんな助けでも大歓迎です!ありがとうございました!

Sub ChangeShadingColor()
Dim myTable As Table
Dim cll As Cell

For Each myTable In ActiveDocument.Tables
myTable.Select
For Each cll In myTable.Range.Cells
        If cll.Shading.BackgroundPatternColor = wdColorBrightGreen Then
           cll.Shading.BackgroundPatternColor = wdColorBlue
        End If
Next
Next myTable
End Sub
4

2 に答える 2

0

前述のように、検索を変更して、色のないセルを探します。≪白≫

変化する

If cll.Shading.BackgroundPatternColor = wdColorBrightGreen Then
   cll.Shading.BackgroundPatternColor = wdColorBlue
End If

If cll.Shading.BackgroundPatternColor <> wdColorWhite Then
   debug.print "Found Cell with Color: " & cll.Shading.BackgroundPatternColor
End If
于 2018-03-28T18:23:38.657 に答える