Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-10-2022, 04:12 PM
Guessed's Avatar
Guessed Guessed is offline Remove shading of specific color from document with multiple shading colors Windows 10 Remove shading of specific color from document with multiple shading colors Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

This might get you started - select a paragraph and run the macro to remove the shading from paragraphs with that same colour.
Note: Your results might vary according to how the colours are applied. In my quick testing the macro was greedy and removed colours from other paragraphs that were coloured from the same row of the colour palette (ie same tint level). It worked fine if the colours came from other levels of tint or were defined in RGB.
Code:
Sub Macro2()
  Dim iCol As Long
  iCol = Selection.Shading.BackgroundPatternColor
  With ActiveDocument.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ""
    .ParagraphFormat.Shading.BackgroundPatternColor = iCol
    .Replacement.ParagraphFormat.Shading.BackgroundPatternColorIndex = wdWhite
    .Execute Replace:=wdReplaceAll
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
color, selection, shading



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove shading of specific color from document with multiple shading colors Remove shading in numbered headings Marcia Word 3 08-21-2020 10:54 AM
Color and Transparency in Word Table shading mikejvir Word Tables 2 07-14-2020 08:48 AM
Remove shading of specific color from document with multiple shading colors Can't apply shading to multiple sentences alex100 Word VBA 5 06-10-2020 09:31 AM
Macro to change an RGB table cell shading color to another RGB color David Matthews Word VBA 4 05-29-2018 02:45 PM
Remove shading of specific color from document with multiple shading colors How to apply formatting(color & shading) to specific letters in whole doc. (arabic) loopseye Word 3 08-05-2013 10:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft