![]() |
|
#9
|
||||
|
||||
|
It seems to me your first macro could be reduced to:
Code:
Sub Demo1()
Application.ScreenUpdating = False
Dim Tbl As Table
For Each Tbl In ActiveDocument.Tables
With Tbl.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Replacement.Font.Color = wdColorBlue
.Format = True
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
.Text = "$[0-9,.]{1;}"
.Replacement.Text = ""
.Execute Replace:=wdReplaceAll
.Text = "\($[0-9,.]{1;}\)"
.Execute Replace:=wdReplaceAll
.Text = "[0-9]{1;}"
.Replacement.Text = "^&"
.Execute Replace:=wdReplaceAll
.Text = "[0-9,.]{2;}"
.Execute Replace:=wdReplaceAll
.Text = "\([0-9]{1;}\)"
.Execute Replace:=wdReplaceAll
.Text = "\([0-9,.]{2;}\)"
.Execute Replace:=wdReplaceAll
.Text = "^="
.Execute Replace:=wdReplaceAll
.Text = "\)\)"
.Replacement.Text = ")"
.Execute Replace:=wdReplaceAll
End With
Next Tbl
Application.ScreenUpdating = True
End Sub
Code:
Sub Demo2()
Application.ScreenUpdating = False
Dim Tbl As Table
For Each Tbl In ActiveDocument.Tables
With Tbl.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Font.Color = wdColorBlue
.Format = True
.Forward = True
.Wrap = wdFindStop
.Replacement.Text = ""
.Execute Replace:=wdReplaceAll
End With
Next Tbl
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Tags |
| cells, helpme, wildcards |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Splitting Tables containing Merged Cells
|
bpike | Word VBA | 7 | 10-28-2020 02:23 AM |
How do I run code on all cells in all tables?
|
wido | Word VBA | 2 | 09-04-2019 05:32 AM |
Can I repeat or self-populate cells/tables?
|
pvh | PowerPoint | 6 | 05-05-2015 03:21 PM |
| Tables in Powerpoint - Hiding Cells | manisfeld | PowerPoint | 2 | 06-08-2014 08:17 PM |
| Shading in Cells in Word Tables | Cindy | Word Tables | 1 | 01-04-2013 02:38 PM |