Sub Casse()
Dim barre As CommandBar
Dim bouton As CommandBarControl
On Error Resume Next
Set barre = CommandBars.Add(Name:="Casse")
barre.Visible = True
Set bouton = CommandBars("Casse").Controls.Add(Type:=msoControlButton)
bouton.BeginGroup = True
bouton.Style = msoButtonCaption
bouton.OnAction = "Majuscule"
bouton.Caption = "MAJ"
bouton.TooltipText = "Majuscule"
Set bouton = CommandBars("Casse").Controls.Add(Type:=msoControlButton)
bouton.BeginGroup = True
bouton.Style = msoButtonCaption
bouton.OnAction = "Minuscule"
bouton.Caption = "Min"
bouton.TooltipText = "Minuscule"
Set bouton = CommandBars("Casse").Controls.Add(Type:=msoControlButton)
bouton.BeginGroup = True
bouton.Style = msoButtonCaption
bouton.OnAction = "NomPropre"
bouton.Caption = "NPr"
bouton.TooltipText = "Nom Propre"
End Sub
Sub Majuscule()
For Each Mot In Selection
If Not Mot.HasFormula Then
Mot.Value = UCase(Mot.Value)
End If
Next Mot
End Sub
Sub minuscule()
For Each Mot In Selection
If Not Mot.HasFormula Then
Mot.Value = LCase(Mot.Value)
End If
Next Mot
End Sub
Sub NomPropre()
For Each Mot In Selection
If Not Mot.HasFormula Then
Mot.Value = Application.Proper(Mot.Value)
End If
Next Mot
End Sub