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
| Sub Effacer_Imprimer()
Dim Monmessage, MonStyle, MonTitle, Monaide, Mavaleur, Response, Machaine
Monmessage = "Souhaitez-vous supprimer les informations contenues dans les tableaux ?" ' Définit le message.
MonStyle = vbYesNo + vbQuestion ' Définit les boutons.
MonTitle = "Informations" ' Définit le titre.
Monaide = "DEMO.HLP" ' Définit le fichier d'aide.
Mavaleur = 1000 ' Définit le contexte de la rubrique.
' Affiche le message.
Response = MsgBox(Monmessage, MonStyle, MonTitle, Monaide, Mavaleur)
If Response = vbYes Then ' L'utilisateur a choisi Oui.
rep = MsgBox("Vous avez supprimer toutes les informations", vbInformation, "Information")
Dim a, b, c, d, e, f As Integer ' Colonne 4
'Valeurs des variables
For b = 8 To 258 ' Lignes
For a = 7 To 7 'Colonnes
Cells(b, a).Interior.ColorIndex = xlNone
Cells(b, a).Value = ""
Next a
Next b
For c = 8 To 258 ' Lignes
For d = 9 To 9 'Lignes
Cells(c, d).Interior.ColorIndex = xlNone
Cells(c, d).Value = ""
Next d
Next c
For e = 8 To 258 ' Lignes
For f = 10 To 10 'Les lignes
Cells(e, f).Interior.ColorIndex = xlNone
Cells(e, f).Value = ""
Next f
Next e
Else ' Si l'utilisateur a choisi Non.
rep = MsgBox("Vous avez supprimer aucunes informations", vbInformation, "Information")
End If
End Sub |
Partager