Excel Programming >> Macro to remove ";"
Function SemiClean(MyStr As String) As String
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 Function
> My field CombMod in huge database contains entries with
> unnecessary semi colons in different places. I need a
> macro to remove them.
>
> For Eaxmple
> ;PM;;;LE;;;;; to become PM;LE
>
> ;PM;;PP PL;PP OP;PP PK;;;;;;QM to become PM;PP PL;PP
> OP;PP PK;QM
>
> Please help
>
>
>
>
>