My Word document contains the text:
The_1234:
(some stuff)
The_1235:
(some stuff)
The_1236:
(some stuff)
............................
I want to be able to search the Word document for the string "The_" and somehow attach the next 4 characters after the string (i.e. "1234") to the string. Then, I will copy/paste the whole selected string "The_1234" into a list, and go to the next occurrence, "The_1235", and so on. To create a list containing all the strings "The_1234, The_1235, The_1236".
So far I have:
Sub FindThe()
Application.ScreenUpdating = False
With Selection.Find
.ClearFormatting
.Text = "The_"
.Execute Forward:=True
End With
End Sub
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…