I have a file contains 38,000 records each row contains 2 or more ';' at the end. is there any formula to remove the end repeated ';' in Excel or any other tool for example
1 Answer
To remove repeated characters (semi-colons in this case)
- Hit CTRL+H
- Find What:
;;(two semicolons) - Replace with:
;(one semicolon) - Click Replace All. When it finishes, repeat Step 4 until there are no more matches found.
Now the document will have no more than one semicolon in a row.
Remove repeated characters using a VBA function:
The following function does the same thing using VBA, and for any character you choose:
Function removeDoubleChars(txt As String, doubleChar As String) As String
'removes all multiple-consecutive [doubleChar] within [txt]
Do
txt = Replace(txt, doubleChar & doubleChar, doubleChar)
Loop While InStr(txt, doubleChar & doubleChar) > 0
removeDoubleChars = txt
End Function
You would use this like Range("A1") = removeDoubleChars ( Range("A1"), ";") to remove consecutive semicolons from cell A1.

;in excel;+$with;