1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Sub Mise_Format()
Dim Cel As Range
Dim Plg, Plg1, Plg2, Plg3, Plg4 As Range
Set Plg1 = Union(Range("TbStg[Nom]"), Range("TbAT[AT nom]"), Range("TbAll[AT nom]"), Range("tbstg[Dir]"))
For Each Cel In Plg1
Cel = UCase(Cel) 'Format : tout en majuscule
Next Cel
Set Plg2 = Union(Range("TbStg[Prénom]"), Range("TbAT[AT prénom]"), Range("TbAll[AT prénom]"))
For Each Cel In Plg2
Cel = Application.WorksheetFunction.Proper(Cel) 'Format : 1er caractère de tous les mots en majuscule
Next Cel
Set Plg3 = Union(Range("TbStg[N° d''agent]"), Range("TbAT[AT user]"), Range("TbAll[AT user]"))
For Each Cel In Plg3
' Format : 1er caractère en majuscule
Cel = UCase(Left(Cel, 1)) & Right(Cel, Len(Cel) - 1)
Next Cel
Set Plg = Union(Plg1, Plg2, Plg3)
'Pour faire les tests, je mets tout en minuscule
'For Each Cel In Plg
' Cel = LCase(Cel)
'Next Cel
End Sub |
Partager