bonsoir,
voici le code adapté, pour la version FR il faut sans doute remplacer le point par la virgule
les formats date et time sont ignorés, pour les format personnalisés, il y a sans doute encore des cas qui ne passeront pas de même le format currency (monnaie ?)
'Const separateurdedecimale = "."
const separateurdedecimale=","
Sub pdd()
For Each c In Selection
pc = ""
f = c.NumberFormat
If f = "General" Then f = "0"
If f Like "*[mMYyAaDdJjSs]" Then Exit Sub
If InStr(f, "%") Then f = Left(f, Len(f) - 1): pc = "%"
If InStr(f, separateurdedecimale) = 0 Then f = f & ".0" Else f = f & "0"
c.NumberFormat = f & pc
Next
End Sub
Sub mdd()
For Each c In Selection
pc = ""
f = c.NumberFormat
If f = "General" Then f = "0"
If f Like "*[mMYyAaDdJjSs]" Then Exit Sub
If InStr(f, "%") Then f = Left(f, Len(f) - 1): pc = "%"
If InStr(f, separateurdecimale) <> 0 Then f = Left(f, Len(f) - 1)
c.NumberFormat = f & pc
Next
End Sub