Re : Caracteres speciaux
Re bonjour,
C T juste pour creer des sheet sans caractere speciaux voici la fct VBA et son invert
Function ReplaceSpecialChar(StrToConvert As String) As String
StrToConvert = Replace(StrToConvert, ":", "#" & Asc(":"))
StrToConvert = Replace(StrToConvert, "/", "#" & Asc("/"))
StrToConvert = Replace(StrToConvert, "\", "#" & Asc("\"))
StrToConvert = Replace(StrToConvert, "[", "#" & Asc("["))
StrToConvert = Replace(StrToConvert, "]", "#" & Asc("]"))
StrToConvert = Replace(StrToConvert, "?", "#" & Asc("?"))
StrToConvert = Replace(StrToConvert, "*", "#" & Asc("*"))
If Len(StrToConvert) < 31 Then
ReplaceSpecialChar = "ERROR " & StrToConvert & " has more then 31 charcter!"
Else
ReplaceSpecialChar = StrToConvert
End If
End Function
-------------------------------------
Function InvertOfReplaceSpecialChar(StrToConvert As String) As String
StrToConvert = Replace(StrToConvert, "#" & Asc(":"), ":")
StrToConvert = Replace(StrToConvert, "#" & Asc("/"), "/")
StrToConvert = Replace(StrToConvert, "#" & Asc("\"), "\")
StrToConvert = Replace(StrToConvert, "#" & Asc("["), "[")
StrToConvert = Replace(StrToConvert, "#" & Asc("]"), "]")
StrToConvert = Replace(StrToConvert, "#" & Asc("?"), "?")
StrToConvert = Replace(StrToConvert, "#" & Asc("*"), "*")
InvertOfReplaceSpecialChar = StrToConvert
End Function
Merci