View Single Post
 
Old 04-17-2018, 12:42 AM
Lady_Laughsalot Lady_Laughsalot is offline Windows 10 Office 2016
Novice
 
Join Date: Apr 2018
Posts: 3
Lady_Laughsalot is on a distinguished road
Default

Hi Macropod
Thanks for this - I've run the code but it has a compile error variable not defined message and the word .Replacement was highlighted - any ideas?
Thanks, Shelley

Quote:
Originally Posted by macropod View Post
It seems to me that all you need is:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument.Range.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Text = ""
  .Replacement.Text = ""
  .Forward = True
  .Format = True
  .Wrap = wdFindContinue
  For i = 1 To 4
    .Style = "Heading " & i
    .Replacement.Style = "Schedule Level " & i
    .Execute Replace:=wdReplaceAll
  Next
End With
Application.ScreenUpdating = True
End Sub
Reply With Quote