é-ö-à

  • Thread starter Luc Vandenhoeck
  • Start date
L

Luc Vandenhoeck

Hi
Thx for solving the spacing problem.
I also want to change è,é,à,ö .. into the normal e,a,o. Is there a function
in Excel?
GRTZ, Luc
 
P

PeterAtherton

Hi Luc

You can try this macro. Copy it in to a vb Module and run it.

Sub RemoveAccents()
' Prepare European name for e-mail address
' works on selection
' best to copy the original data and work on copy

Dim i As Integer, c
Dim char As String
Application.ScreenUpdating = False
For Each c In Selection
c.Select
c = LCase(c) 'make text lower case

For i = 1 To Len(c)
char = Mid(c, i, 1)
If char Like "[àáâãäåæ]" Then
Mid(c, i, 1) = "a"
ElseIf char Like "[ç¢]" Then
Mid(c, i, 1) = "c"
ElseIf char Like "[èéêë]" Then
Mid(c, i, 1) = "e"
ElseIf char Like "[ìíîï]" Then
Mid(c, i, 1) = "i"
ElseIf char = "ñ" Then
Mid(c, i, 1) = "n"
ElseIf char Like "[ðòóôõö]" Then
Mid(c, i, 1) = "o"
ElseIf char Like "[ùúûü]" Then
Mid(c, i, 1) = "u"
ElseIf char = "ž" Then
Mid(c, i, 1) = "z"
End If
Next i
ActiveCell.Value = c
Next
Application.ScreenUpdating = True
End

Press ALT + F11, Insert Module, Copy code, Return to workbook.

Select a COPY of the data Press ALT + F8, select the macro and clilck Run

Regards
eter
 
Top