Function shuntSpec_Char(chaine)
Dim t$, I&, c$
For I = 1 To 26: t = t & Left(Cells(1, I).Address(0, 0), 1) & " ": Next
t = t & LCase(t) & "0 1 2 3 4 5 6 7 8 9 "
'on obtient "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9"
For I = 1 To Len(chaine)
If InStr(1, t, Mid(chaine, I, 1)) Then c = c & Mid(chaine, I, 1)
Next
shuntSpec_Char = c
End Function
Sub test()
MsgBox shuntSpec_Char("ajurb?:;dlkf#,')(_-sdkdje")
End Sub
Function shuntSpec_Char2(chaine)
For I = 1 To Len(chaine)
Select Case Asc(Mid(chaine, I, 1))
Case 97 To 122, 65 To 90, 48 To 57
c = c & Mid(chaine, I, 1)
End Select
Next
shuntSpec_Char2 = c
End Function
Sub test2()
MsgBox shuntSpec_Char2("ajurb?:;dlkf#,')(_-sdkdje")
End Sub
Mercire
ou plus draconien
Code:Function shuntSpec_Char2(chaine) For I = 1 To Len(chaine) Select Case Asc(Mid(chaine, I, 1)) Case 97 To 122, 65 To 90, 48 To 57 c = c & Mid(chaine, I, 1) End Select Next shuntSpec_Char2 = c End Function Sub test2() MsgBox shuntSpec_Char2("ajurb?:;dlkf#,')(_-sdkdje") End Sub