1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| Sub MiaouBox()
Dim Verif As Boolean, Plage As Range
On Error GoTo fin
Set Plage = Application.InputBox("Sélectionnez une cellule ou une plage de cellule", "Selection", , , , , , 8)
recom:
With Assistant
.Visible = True
.Filename = "offcat.acs"
.On = True
With .NewBalloon
.Heading = "QUELLE COULEUR ?"
.Text = "Cellules sélectionnées" & Chr(10) & Plage.Address(0, 0)
.CheckBoxes(1).Text = "rouge"
.CheckBoxes(2).Text = "jaune"
.CheckBoxes(3).Text = "bleu"
.CheckBoxes(4).Text = "vert"
.CheckBoxes(5).Text = "aucune"
.Show
For i = 1 To 5
If .CheckBoxes(i).Checked = True Then
Verif = True
Select Case i
Case 1: Plage.Interior.ColorIndex = 3
Case 2: Plage.Interior.ColorIndex = 6
Case 3: Plage.Interior.ColorIndex = 5
Case 4: Plage.Interior.ColorIndex = 10
Case 5: Plage.Interior.ColorIndex = xlNone
End Select
Exit For
End If
Next
End With
End With
If Verif = False Then
MsgBox "veuillez faire un choix svp !"
GoTo recom
End If
Assistant.On = False
Assistant.Visible = False
Exit Sub
fin:
MsgBox "opération annulée"
End Sub |
Partager