vba turn off shading of selection

User avatar
Charles Kenyon
5StarLounger
Posts: 621
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

vba turn off shading of selection

Post by Charles Kenyon »

I am trying to turn off the shading of a range. That is, set it to no shading.
I can set it to white, which usually will be fine, but not turn off shading altogether.

If I set it to Automatic, it is black.

User avatar
HansV
Administrator
Posts: 78531
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: vba turn off shading of selection

Post by HansV »

Try this:

Code: Select all

    Dim rng As Range
    Set rng = ...
    With rng.Shading
        .Texture = wdTextureNone
        .ForegroundPatternColor = wdColorAutomatic
        .BackgroundPatternColor = wdColorAutomatic
    End With
Best wishes,
Hans

User avatar
Charles Kenyon
5StarLounger
Posts: 621
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: vba turn off shading of selection

Post by Charles Kenyon »

Thank you. I will give that a try.