Parfois, je trouve qu'il est nécessaire de chasser l'aiguille dans la botte de foin - un caractère qui ne s'affiche pas. Si vous voulez voir quels caractères vous pouvez avoir dans une chaîne, vous pouvez essayer le code suivant. Il vous permet d'ignorer les caractères communs ...
Dim YourString As String
Dim blnSkipNbr As Boolean
Dim blnSkipUC As Boolean
Dim blnSkipLC As Boolean
Dim blnSkipSpecial As Boolean
blnSkipNbr = True ' Set to tru to not display numbers
blnSkipUC = True ' Skip UC
blnSkipLC = True ' Skip LC
blnSkipSpecial = True ' Skip special
' 32-47 = Special (space, !,(), etc.)
' 48-57 = 0 to 9
' 65-90 = A to Z
' 97-122 = a to z
YourString = "Now is the time...!#$" & vbCrLf
For i = 1 To Len(YourString)
char = Mid(YourString, i, 1)
Do
If blnSkipNbr = True And Asc(char) >= 48 And Asc(char) <= 57 Then Exit Do
If blnSkipUC = True And Asc(char) >= 65 And Asc(char) <= 90 Then Exit Do
If blnSkipLC = True And Asc(char) >= 97 And Asc(char) <= 122 Then Exit Do
If blnSkipSpecial = True And Asc(char) >= 97 And Asc(char) <= 122 Then Exit Do
Debug.Print "In position " & i & " of string: Char: " & ">" & char & "<" & vbTab & vbTab & "Asc(" & Asc(char) & ")"
Exit Do
Loop
Next i
https://en.wikipedia.org/wiki/Enquiry_character – Will
Comment un utilisateur entrerait cela? Il a été entré au milieu d'une chaîne (ex: "JO [This Character] BS) – ferensilver
Beaucoup de façons différentes, mais à la fin, qui s'en soucie? Il est là, vous devez y faire face. – Will