![]() |
#5
|
|||
|
|||
![]() Quote:
Sub CaptionPort() ' ' Use this macro to replace captions and tables for portrait orientation With Selection.Tables Dim aTbl As Table For Each aTbl In Selection.Tables aTbl.Range.Cells(1).Range.Select Caption Table1 Next aTbl End With End Sub After the macros run there are two paragraphs between my tables and I'd like only one. The problem I'm running into is that the original selection I've highlighted is lost as my table1 macro is run on each table. Is there a way to save my original selection from the start and recall it after the two macros have run to then run my find and replace macro? Thanks!! Sub ParagraphCleanup() ' ' ParagraphCleanup Macro ' ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^p^p" .Replacement.Text = "^p" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub |
Tags |
macro find and replace |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word VBA Find Table Text Shading Colour and replace with another | QA_Compliance_Advisor | Word VBA | 10 | 09-19-2014 08:36 AM |
![]() |
bennymc | Word VBA | 1 | 01-27-2014 04:23 PM |
![]() |
peytontodd | Word | 1 | 10-28-2013 09:39 AM |
Find - Replace Macro using a table list | mdw | Word | 0 | 08-01-2013 04:36 PM |
![]() |
jperez84 | Word VBA | 10 | 09-19-2012 04:48 PM |