'Callback for Cel13 onAction
Sub CelluleCarree(control As IRibbonControl)
Dim Cellule As Range
For Each Cellule In Selection
Cellule.RowHeight = Cellule.Width
Next
End Sub
'Callback for Cel12 onAction
Sub LignesEnCm(control As IRibbonControl)
Dim cm As Single
cm = Application.InputBox("Hauteur de la rangée en cm.", Type:=1)
If cm Then
Selection.RowHeight = Application.CentimetersToPoints(cm)
End If
End Sub
'Callback for Cel11 onAction
Sub ColonnesEnCm(control As IRibbonControl)
Dim cm As Single, points As Single
Dim count As Single
Application.ScreenUpdating = False
cm = Application.InputBox("Largeur de la colonne en cm.", Type:=1)
If cm = False Then Exit Sub
points = Application.CentimetersToPoints(cm)
savewidth = ActiveCell.ColumnWidth
ActiveCell.ColumnWidth = 255
If points > ActiveCell.Width Then
MsgBox "La largeur de" & cm & "est trop large" & Chr(10) & _
"la valeur maxi est de " & _
Format(ActiveCell.Width / 28.3464566929134, _
"0.00"), vbOKOnly + vbExclamation, "Largeur non valable"
ActiveCell.ColumnWidth = savewidth
Exit Sub
End If
lowerwidth = 0
upwidth = 255
ActiveCell.ColumnWidth = 127.5
curwidth = ActiveCell.ColumnWidth
count = 0
While (ActiveCell.Width <> points) And (count < 20)
If ActiveCell.Width < points Then
lowerwidth = curwidth
Selection.ColumnWidth = (curwidth + upwidth) / 2
Else
upwidth = curwidth
Selection.ColumnWidth = (curwidth + lowerwidth) / 2
End If
curwidth = ActiveCell.ColumnWidth
count = count + 1
Wend
End Sub
Sub Epson(control As IRibbonControl)
On Error Resume Next
Application.ActivePrinter = "EPSON Stylus DX9400F Series sur Ne03:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"EPSON Stylus DX9400F Series sur Ne03:", Collate:=True
On Error GoTo 0
End Sub
Sub Envoi(control As IRibbonControl)
MsgBox "Ouverture de Outlook"
End Sub