Replacing

link to REPLACE function


Public Function ReplaceText(ByVal sExpression As String, _ 
                   ByVal sReplace As String, _
                   ByVal sReplaceWith As String) As String

   Dim sNewText As String
    sNewText = sExpression

   sNewText = Replace(sNewText, StrConv(sReplace, vbLowerCase), StrConv(sReplaceWith, vbLowerCase),,, vbBinaryCompare)

   sNewText = Replace(sNewText, StrConv(sReplace, vbUpperCase), StrConv(sReplaceWith, vbUpperCase),,, vbBinaryCompare)

   sNewText = Replace(sNewText, StrConv(sReplace, vbProperCase), StrConv(sReplaceWith, vbProperCase),,, vbBinaryCompare)

End Function




© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

Top

PrevNext