![]() |
#1
|
|||
|
|||
![]()
Hi,
I have been using this macro for a long time to copy a paragraph. Recently it has stopped working and is giving an error message: run time eroro 4605 Does anyone have any idea what happened Thanks a lot. Sub COPYPAR() 'Copy a range from the current para's start till after "=" and 'paste it after the para. Dim oRng As Range Set oRng = Selection.Paragraphs(1).Range Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With oRng.Find .Text = "=" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = False If .Execute Then oRng.Start = Selection.Paragraphs(1).Range.Start oRng.Copy Selection.Paragraphs(1).Range.Select Selection.Collapse wdCollapseEnd Selection.InsertAfter vbCr Selection.Collapse Selection.PasteAndFormat (wdFormatOriginalFormatting) End If End With End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro/VBA to copy text paragraph and insert as new row in summary table, with RAG | l0zzie88 | Word VBA | 2 | 01-18-2024 03:42 PM |
Copy the entire paragraph in wildcards | asderam | Word VBA | 0 | 01-28-2021 05:54 PM |
![]() |
Productivity | Word VBA | 2 | 10-25-2019 06:40 AM |
![]() |
WordNoobx | Word | 6 | 05-15-2018 05:46 AM |
Copy text to new document based on paragraph numbering | mike.mm | Word VBA | 7 | 11-22-2016 06:14 AM |