Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 01-09-2022, 02:54 AM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help, How to do a Find in a Table, then Shade color? Windows 10 Help, How to do a Find in a Table, then Shade color? Office 2019
Competent Performer
Help, How to do a Find in a Table, then Shade color?
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default I had to modify to do a Find & Replace only on Bold+Highlighted...

OK Thanks, I will try to do that with my own personal computer later.

Regarding my above Script, since myself I'm having trouble with many different color (could it be because it's an Index, vs wdColor name, or it's the Theme Office 2007 - 2010), my table didn't work if more than the Green color.

See below the Theme:
Change a theme and make it the default in Word or Excel

So I've opted to use only = IF some texte are Bold & Highlighted, Then Apply the Style with background Orange (color of my chosing, in the Style created prior on One cell).

I have not activated the colors below with the single apostrophe, but I wanted to show the coded numbers or color name, if you wanted to try. On my side, it didn't work. Oh and by the way, I had a new situation, where I wanted to ID it, so I had to add another color, DarkRed, as you will see in my new script.

Below, is the new script below:

Code:
    Selection.Find.ClearFormatting
    Selection.Find.Highlight = True
    With Selection.Find.Font
        .Bold = True
       '.Color = 5287936        'Green
       '.Color = 1857256        'Red
       '.Color = wdColorRed          'Red
       '.Color = wdColorDarkRed      'DarkRed
       '.Color = wdColorGreen        'Green
    End With
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Style = ActiveDocument.Styles( _
        "Cell Colr Org para")
    With Selection.Find
        .Text = "&"
        .Replacement.Text = "^&"
        .Forward = True
        .Wrap = wdFindStop
        .Format = True
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
As mentioned before, I will try from my personal PC a little later, to send you the test document, where the script above, didn't work. Been at this all night, so now I will sleep

Thanks for your patience my friend.

Cendrinne
Reply With Quote
 

Tags
macro help, shade a cell, word table macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help, How to do a Find in a Table, then Shade color? Conditionally Shade Table Cells S7ewie Mail Merge 8 04-29-2021 01:52 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
Help, How to do a Find in a Table, then Shade color? Code to find a named (bookmarked?) table, replicate a row or table, and delete a specified table. kevinbradley57 Word VBA 9 09-21-2017 04:58 PM
Help, How to do a Find in a Table, then Shade color? Text area in table won't shade LSHAW Word Tables 1 03-09-2017 03:08 PM
Help, How to do a Find in a Table, then Shade color? VBA Table – Search All Tables - Find & Replace Text in Table Cell With Specific Background Color jc491 Word VBA 8 09-30-2015 06:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:07 AM.


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