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
| Private Sub CommandButton3_Click()
ActiveCell.Select 'enève le focus au bouton
Select Case Me.CommandButton3.Caption 'agit en fonction du texte du bouton
Case "NOUVELLE ENTREE AED" 'cas "Masquer"
Me.CommandButton3.Caption = "VALIDER" 'modifie le texte du bouton
Range("G1,M1,N1,P1,Z1,AA1").EntireColumn.Hidden = False
derlig = Range("A65536").End(xlUp).Row + 1
Worksheets("GENERAL").Range("A" & derlig).EntireRow.Insert
Worksheets("GENERAL").Range("A" & derlig).EntireRow.ClearContents
Worksheets("GENERAL").Range("A" & derlig).EntireRow.Interior.ColorIndex = xlNone
Worksheets("GENERAL").Range("A" & derlig).Select
Dim z As Long
Application.ScreenUpdating = False
For z = Cells(Rows.Count, "A").End(xlUp).Row To 3 Step -1
If Range("A" & z) <> "" Then Rows(z).Hidden = True
Next z
Application.ScreenUpdating = True
Worksheets("GENERAL").Range("A" & derlig).Select
Case "VALIDER" 'cas "Afficher"
Me.CommandButton3.Caption = "NOUVELLE ENTREE AED" 'modifie le texte du bouton
Application.ScreenUpdating = False
For z = Cells(Rows.Count, "A").End(xlUp).Row To 3 Step -1
If Range("A" & z) <> "" Then Rows(z).Hidden = False
Next z
End Select 'fin de l'action en fonction du texte du bouton |