Private Sub CommandButton1_Click()
Sheets("Charge de projet").Unprotect Password:="andromede" 'retire la protection
Dim CC As Comment
If ActiveCell.Row < 8 Then Exit Sub
Message = InputBox("Commentaire : ")
If Message = "" Then Exit Sub
Cells(ActiveCell.Row, 4).Select
ActiveCell.ClearComments ' il est possible qu'il y ait deja un commentaire
Set CC = Selection.AddComment
CC.Text Message
End Sub
Private Sub CommandButton2_Click()
Sheets("Charge de projet").Unprotect Password:="andromede" 'retire la protection
Call Suppr
Sheets("Charge de projet").Protect Password:="andromede" 'On protège
End Sub
Private Sub creer_ligne_Click()
Sheets("Charge de projet").Unprotect Password:="andromede" 'retire la protection
Dim NumLigne As Long
NumLigne = ActiveSheet.Range("B65536").End(xlUp).Offset(1, 0).Row ' ligne vide du tableau
Application.ScreenUpdating = False
If ActiveSheet.Range("C" & NumLigne - 1).Value <> "" Then
ActiveSheet.Range("B" & NumLigne).EntireRow.Hidden = False ' Démasque la ligne qui suit
Else
MsgBox "Vous n'avez pas rempli le domaine ", _
vbExclamation, " Attention ! "
End If
Application.ScreenUpdating = True
Sheets("Charge de projet").Protect Password:="andromede" 'On protège
End Sub
Private Sub filtre_Click()
Sheets("Charge de projet").Unprotect Password:="andromede" 'retire la protection
Range("B7:N7").Select
Selection.AutoFilter
End Sub
Private Sub Worksheet_change(ByVal Target As Range)
Sheets("Charge de projet").Unprotect Password:="andromede" 'retire la protection
Call Couleur
Sheets("Charge de projet").Protect Password:="andromede" 'On protège
End Sub