![]() |
|
#3
|
||||
|
||||
|
You need to identify the table the cells are in e.g.
Code:
Function ChangeLogo(wdDoc)
Dim oTable As Table
Dim ocell As Cell
Set oTable = wdDoc.Tables(1)
For Each ocell In oTable.Range.Cells
With ocell.Shading
If .BackgroundPatternColor = RGB(51, 51, 153) Then
.BackgroundPatternColor = RGB(12, 71, 157)
.ForegroundPatternColor = wdColorWhite
End If
End With
Next ocell
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro to find text and replace with form field containing that text
|
iiiiifffff | Word VBA | 16 | 06-04-2016 01:47 AM |
| Find and Replace multiple table columns | smakdown61 | Word | 1 | 08-28-2014 09:24 PM |
Word VBA Macro to Find and Replace based on the Alt Text of an Image
|
bennymc | Word VBA | 1 | 01-27-2014 04:23 PM |
| Find - Replace Macro using a table list | mdw | Word | 0 | 08-01-2013 04:36 PM |
Bad view when using Find and Find & Replace - Word places found string on top line
|
paulkaye | Word | 4 | 12-06-2011 11:05 PM |