-
-
Save mpecka/dba4344af56fb34744bc60cbfe0e66ef to your computer and use it in GitHub Desktop.
| Function StripAccent(thestring As String) | |
| Dim A As String * 1 | |
| Dim B As String * 1 | |
| Dim i As Integer | |
| Const AccChars= "áäčďéěíĺľňóôőöŕšťúůűüýřžÁÄČĎÉĚÍĹĽŇÓÔŐÖŔŠŤÚŮŰÜÝŘŽ" | |
| Const RegChars= "aacdeeillnoooorstuuuuyrzAACDEEILLNOOOORSTUUUUYRZ" | |
| For i = 1 To Len(AccChars) | |
| A = Mid(AccChars, i, 1) | |
| B = Mid(RegChars, i, 1) | |
| thestring = Replace(thestring, A, B) | |
| Next | |
| StripAccent = thestring | |
| End Function |
Has anybody an idea how I can include these characters to be replaced: "ąśł"
You can add the new accent character to the string AccChars, then add the corresponding 'regular' (non-accented) character to RegChars, in the same position.
Hi
I have a weird behavior, the script returns something, namely the same accented text as before. The characters to be replaced are all in the AccChars/RegChars strings. Any idea what is causing this behavior?
Chris
Actually what I wrote was wrong. The characters are not in the string, they just look similar. When I try to insert the characters I want replaced, Excel puts a questionmark instead of the character. Does this mean the code page I am using for the macro does not support these characters? I can display them on the Excel sheet.
Has anybody an idea how I can include these characters to be replaced: "ąśł"