Macro to remove ";"
Because it is a recursive function (it calls itself) it needs to be a
function, needs the string to be converted passed to it, and needs to be
named "SemiClean"
"JA" wrote:
This macro suggested for my previous question is
returning the error sub or function not defined.
Can some tweak it for me.
Sub Test()
Dim NewStr As String
NewStr = Replace(MyStr, ";;", ";")
If Mid(NewStr, 1, 1) = ";" Then NewStr = Right
(NewStr, Len(NewStr) - 1)
If Right(NewStr, 1) = ";" Then NewStr = Left(NewStr,
Len(NewStr) - 1)
If InStr(NewStr, ";;") Then NewStr = Clean(NewStr)
SemiClean = NewStr
End Sub
|