View Single Post
 
Old 02-08-2022, 03:13 AM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default Help please, Script to Delete Paragraph marks b4 Tables

Hello Pros,
Another issue, I can't figure out. At times, I have many tables in a row, seperated with 2 or 3 paragraph marks. Upon Selection, so I have the control to select all the tables I wish to remove the paragraph marks B4 or After a table.

Since they have the same column size and same number of columns, I wish to merge them together.

I already have a macro which I've put the last row with the color Red, so it's OK to merge many tables together.

I have succeeded to do a Cut, but on the last one, I'm in a loop


HTML Code:
   Selection.Select
   
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "^p"
        .Wrap = wdFindStop
        .Forward = True
        .MatchWholeWord = True
    End With
    
     Do While Selection.Find.Execute
       If Selection.Find.found Then
         Selection.Cut
    
       Else
    
       Selection.Find.Execute Replace:=wdReplaceAll
       
       End If
     
    Loop
       
    On Error GoTo 0
I've selected all the paragraphs marks in between many tables, but it get's stuck on Loop. So after Forcing to stop Word, i've used F8 for each steps, and I can see why the Loop gets stuck. I don't know how to have it done ONLY on the selection.

Is it possible?

Any insights would be sooooooo appreciated.

Cendrinne.
Reply With Quote