View Single Post
 
Old 09-23-2018, 08:04 PM
vjvj123 vjvj123 is offline Windows 10 Office 2016
Novice
 
Join Date: Sep 2018
Posts: 11
vjvj123 is on a distinguished road
Default

Thanks again.

Not sure if I am doing sth wrong, but get an error message in the 'If' statement that you provided as a replacement, my macro is like this now:

Code:
Sub Macro15()
Application.ScreenUpdating = False
Dim Rng As Range, i As Long
With ActiveDocument.Tables(1)
  Set Rng = .Range
  With .Range
    With .Find
      .ClearFormatting
      .Replacement.ClearFormatting
      .Text = "#"
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindStop
      .Format = False
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
      .Execute
    End With
    If .Find.Found = True
      .MoveEnd Unit:=wdCell, Count:=1
      .Text = vbNullString
    End If
  End With
End With
Application.ScreenUpdating = True
End Sub
Reply With Quote