Bonjour,

J'ai besoin d'un peu d'aide !
J'ai 4 cases à cocher mais quand j'attribue la case à cocher sur la macro cela ne marche pas.
Quand on coche la case "pret", toutes les lignes dans la colonne B se masquent et si on décoche elles s'affichent. ceci pour les autres cases a cocher.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 MasqueDepot()
Dim Lg&
    Lg = Range("b" & Rows.Count).End(xlUp).Row
    If Range("a4") = True Then
        On Error Resume Next
        Range("b10:b" & Lg).SpecialCells(xlCellTypeBlanks).Rows.Hidden = True
        On Error GoTo 0
    Else
        Cells.Rows.Hidden = False
    End If
End Sub
 
 
Sub MasquePlt()
Dim Lg&
    Lg = Range("b" & Rows.Count).End(xlUp).Row
    If Range("a3") = True Then
        On Error Resume Next
        Range("b10:b" & Lg).SpecialCells(xlCellTypeBlanks).Rows.Hidden = True
        On Error GoTo 0
    Else
        Cells.Rows.Hidden = False
    End If
End Sub
 
Sub MasquePret()
Dim Lg&
    Lg = Range("b" & Rows.Count).End(xlUp).Row
    If Range("a2") = True Then
        On Error Resume Next
        Range("b10:b" & Lg).SpecialCells(xlCellTypeBlanks).Rows.Hidden = True
        On Error GoTo 0
    Else
        Cells.Rows.Hidden = False
    End If
End Sub
 
Sub MasqueHs()
Dim Lg&
    Lg = Range("b" & Rows.Count).End(xlUp).Row
    If Range("a5") = True Then
        On Error Resume Next
        Range("b10:b" & Lg).SpecialCells(xlCellTypeBlanks).Rows.Hidden = True
        On Error GoTo 0
    Else
        Cells.Rows.Hidden = False
    End If
End Sub