Hi,
i'm a beginner and i need a macro that look for a specific word, then merge that table an go further.
I've created a macro but it doesn't go out of the loop.
I have this Word:

Sub MergeSpecificRowInOneCell()

Selection.WholeStory

 Selection.Find.ClearFormatting
    Selection.Find.Font.Italic = True
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "Dispensato"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Do While Selection.Find.Execute

        If Selection.Information(wdWithInTable) Then

Selection.SelectRow
Selection.Cells.Merge

        End If
    Loop
End Sub

Hi,
i founded this but just works in the first case:

Sub ProcessScriptTable()
  Dim counter As Integer
  For counter = 1 To ActiveDocument.Tables.Count
      ActiveDocument.Tables(counter).Select
       With Selection.Find
            .Text = "Dispensato"
            .Wrap = wdFindContinue
        End With
        Selection.Find.Execute
        If Selection.Information(wdWithInTable) Then
            Selection.SelectRow
            Selection.Cells.Merge
        End If
  Next
  counter = counter + 1
 End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.