What is required to find two words please

S

Steved

<[A-Za-z]@>-<[A-Za-z]@> will find CULLEN-SONET

What is required to find the below examples please.
DCASH-SKAI GLORY
GOLD BROSE-MOLINEUX
WOODBURY LAD-FASHION COURT
VOLKSRAAD-WALKIN ON SUNSH

Thankyou
 
G

Graham Mayor

You can find the hyphenated words, but random phrases are impossible to
find - unless they are all known beforehand and you use an array eg.

Sub ReplaceList()
Dim vFindText As Variant
Dim vReplText As Variant
Dim i As Long
vFindText = Array("DCASH-SKAI GLORY", "GOLD BROSE-MOLINEUX", _
"WOODBURY LAD-FASHION COURT", "VOLKSRAAD-WALKIN ON SUNSH")
vReplText = Array("WORD1", "WORD2", "WORD3", "WORD4")
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = True
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText(i)
.Execute replace:=wdReplaceAll
Next i
End With
End Sub
 
S

Steved

Hello Graham from Steved

Thankyou

Graham Mayor said:
You can find the hyphenated words, but random phrases are impossible to
find - unless they are all known beforehand and you use an array eg.

Sub ReplaceList()
Dim vFindText As Variant
Dim vReplText As Variant
Dim i As Long
vFindText = Array("DCASH-SKAI GLORY", "GOLD BROSE-MOLINEUX", _
"WOODBURY LAD-FASHION COURT", "VOLKSRAAD-WALKIN ON SUNSH")
vReplText = Array("WORD1", "WORD2", "WORD3", "WORD4")
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = True
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText(i)
.Execute replace:=wdReplaceAll
Next i
End With
End Sub
<[A-Za-z]@>-<[A-Za-z]@> will find CULLEN-SONET

What is required to find the below examples please.
DCASH-SKAI GLORY
GOLD BROSE-MOLINEUX
WOODBURY LAD-FASHION COURT
VOLKSRAAD-WALKIN ON SUNSH

Thankyou
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Find Next row 3
Please Help A.S.A.P 2
Awful example of HTML rendering 0

Top