I have a document in Word of the form:
Question 1: Chdsh
Question 1: aghj
Lesson 1: ghj
Lesson 2: sagdhj
Is there a way to quickly change the "Question 1, .." and "Lesson 1, ..." to automatic numbering? Thanks everyone
I have a document in Word of the form:
Question 1: Chdsh
Question 1: aghj
Lesson 1: ghj
Lesson 2: sagdhj
Is there a way to quickly change the "Question 1, .." and "Lesson 1, ..." to automatic numbering? Thanks everyone
If you created a new list style called say QL List and made the Level 1 number format "Question 1" and the Level 2 number format "Lesson 1" then you could use a find and replace something like this:
Sub A() Dim oRng As Range Set oRng = ActiveDocument.Range With oRng.Find .Text = "Question [0-9]@: @" .MatchWildcards = True While .Execute oRng.Delete oRng.Paragraphs(1).Range.Style = "QL List" oRng.Collapse wdCollapseEnd Wend End With Set oRng = ActiveDocument.Range With oRng.Find .Text = "Lesson [0-9]@: @" .MatchWildcards = True While .Execute oRng.Delete oRng.Paragraphs(1).Range.Style = "QL List" oRng.ListFormat.ListLevelNumber = 2 oRng.Collapse wdCollapseEnd Wend End With End Sub
Oh sorry it doesn't work
If is doesn't work then apparently you didn't properly create and define a new list style titled "QL List" or applied the code wrong. "Sorry, it doesn't work" isn't going to get you much help here.