Re : format textbox securite sociale
re tous,
j ai trouvé e code sur excel labo pour ceux qui en aurait besoin
Private sub txtSS_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
Dim nc As Integer, s As String
s = Trim(txtSSS): nc = Len(s)
If nc = 0 Then exit sub
If (nc <> 15 And nc <> 13) Or Not IsNumeric(s) Then
MsgBox "Vous devez entrer 13 ou 15 chiffres sans espaces", , "Test"
txtSSS = ""
Else
txtSSS = Format(s, IIf(nc = 15, "0 00 00 00 000 000|00", _
"0 00 00 00 000 000"))
End If
end sub
cordialement
GHISLAIN