Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
Global replace of Table Shading
You can use macros to quickly change cell shading and all other properties of
cells, rows, columns and entire tables. The macro below checks the cell shading of all cells in the *selection*. If the cell has the shading you search for (oColor_Old), the shading will be replaced by the shading defined as oColor_New. If not, no changes will be made to the cell. Before executing the macro, select the part of the document that contains the cells you want to search (single cell(s), row(s), columns(s), whole table(s) or even the entire document as you wish). TIP: To find the names of the colors to use, you can record a macro in which you change the shading of 2 cells to the old and new color, respectively. In the recorded macro, find the values of BackgroundPatternColor. Here is the macro: Sub ChangeTableCellShading_SelectedCells() Dim oCell As Cell Dim oColor_Old As WdColor Dim oColor_New As WdColor 'Replace the shading below by the one to search for: oColor_Old = wdColorYellow 'Replace the shading below by the new shading to apply: oColor_New = wdColorBrightGreen 'iterate through all cells in the selection For Each oCell In Selection.Range.Cells 'If shading is the one being search for, replace it With oCell.Shading If .BackgroundPatternColor = oColor_Old Then .BackgroundPatternColor = oColor_New End If End With Next oCell End Sub -- Regards Lene Fredborg "MJSEA" wrote: Is there a quick way to search for a particular shading color within a row and replace it with a different color? Is it possible to search for any other table properties and replace them, e.g., table size? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trouble Sorting Table | Microsoft Word Help | |||
Document Styles should be assignable to fonts in Table AutoFormat | Tables | |||
table cells loose shading during merge operation | Mailmerge | |||
Table AutoFormats vs. Table Styles confusion | Tables | |||
MAKRO Help needed: Search & Replace from Top to start of Table | Microsoft Word Help |