A
avkokin
Hello.
Mr. Allen Wyatt publish code of one function which provide replace one
text to other (http://wordtips.vitalnews.com/Pages/
T000811_Replacing_Text_in_a_Macro.html). However I can't call it into
macro. How to correct take advantage of the opportunity this function?
That is this function and my macro:
Function RepText(sIn As String, sFind As String, sRep As String) As
String
Dim x As Integer
x = InStr(sIn, sFind)
While x > 0
sIn = Left(sIn, x - 1) & sRep & Mid(sIn, x + Len(sFind))
x = InStr(sIn, sFind)
Wend
RepText = sIn
End Function
Sub findWord()
sIn = Selection.Text
sFind = "the"
sRep = "of"
End Sub
Thank you for your tips.
Mr. Allen Wyatt publish code of one function which provide replace one
text to other (http://wordtips.vitalnews.com/Pages/
T000811_Replacing_Text_in_a_Macro.html). However I can't call it into
macro. How to correct take advantage of the opportunity this function?
That is this function and my macro:
Function RepText(sIn As String, sFind As String, sRep As String) As
String
Dim x As Integer
x = InStr(sIn, sFind)
While x > 0
sIn = Left(sIn, x - 1) & sRep & Mid(sIn, x + Len(sFind))
x = InStr(sIn, sFind)
Wend
RepText = sIn
End Function
Sub findWord()
sIn = Selection.Text
sFind = "the"
sRep = "of"
End Sub
Thank you for your tips.