Unless there is at least one unformatted paragraph between each coloured block, the results are likely to be unpredictable, but the following might work for you
Option Explicit
Sub Macro1()
Dim oRng As Range, oTable As Range
Set oRng = ActiveDocument.Range
With oRng.Find
Do While .Execute("|")
If oRng.Paragraphs(1).Range.ParagraphFormat.Shading.BackgroundPatternColor = _
RGB(220, 220, 220) Then
Set oTable = oRng.Paragraphs(1).Range
Do While oTable.Next.ParagraphFormat.Shading.BackgroundPatternColor = RGB(220, 220, 220)
oTable.End = oTable.Next.End
Loop
oRng.End = oTable.End
oTable.Text = Replace(oTable.Text, "|", "")
oTable.ConvertToTable NumColumns:=3, NumRows:=3, AutoFitBehavior:=wdAutoFitFixed
With oTable.Tables(1)
.Style = "Table Grid"
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = False
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = False
.Range.ParagraphFormat.Shading.BackgroundPatternColor = wdColorAutomatic
.Shading.BackgroundPatternColor = RGB(220, 220, 220)
End With
End If
oRng.Collapse 0
Loop
End With
Set oRng = ActiveDocument.Range
With oRng.Find
Do While .Execute("|")
If oRng.Paragraphs(1).Range.ParagraphFormat.Shading.BackgroundPatternColor = _
RGB(209, 209, 209) Then
Set oTable = oRng.Paragraphs(1).Range
Do While oTable.Next.ParagraphFormat.Shading.BackgroundPatternColor = RGB(209, 209, 209)
oTable.End = oTable.Next.End
Loop
oRng.End = oTable.End
oTable.Text = Replace(oTable.Text, "|", "")
oTable.ConvertToTable NumColumns:=2, NumRows:=2, AutoFitBehavior:=wdAutoFitFixed
With oTable.Tables(1)
.Style = "Table Grid"
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = False
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = False
.Range.ParagraphFormat.Shading.BackgroundPatternColor = wdColorAutomatic
.Shading.BackgroundPatternColor = RGB(209, 209, 209)
End With
End If
oRng.Collapse 0
Loop
End With
End Sub