![]() |
#4
|
||||
|
||||
![]()
It would be simpler just to replace 'sample' with 'Sample' in the first cell of each table e.g.
Code:
Sub Macro1() Dim oTable As Table Dim oCell As Range For Each oTable In ActiveDocument.Tables Set oCell = oTable.Cell(1, 1).Range oCell.Text = Replace(oCell.Text, "sample", "Sample") Next oTable Set oCell = Nothing Set oTable = Nothing End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Tags |
find, replace |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
how do I replace string 123-4 with 123 4 | davidjm | Word VBA | 25 | 11-03-2021 02:40 PM |
![]() |
Marcia | Excel Programming | 5 | 05-04-2020 05:15 AM |
![]() |
wardw | Word | 7 | 05-07-2018 09:13 AM |
![]() |
Anthon | Excel Programming | 1 | 11-03-2016 12:48 AM |
![]() |
errtu | Word | 1 | 01-31-2013 02:09 PM |