Bonjour,
La procédure (Efface_catfonct) dans le module, appelée à partir du bouton de l'userForm ne fonctionne pas mais fonctionne à partir du bouton de la feuille Evalué ???
Je ne vois pas ce qui cloche, je tourne en rond
Merci d'avance de votre aide
ci dessous le code dans l'userForm
Le code dans le module
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 Public Sub Imprime_ent_Click() Imprimer_tout End Sub
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 Sub Imprimer_tout() 'Imprimer toutes les feuilles Imprimer_Evalué 'appelle de la procédure 'Imprimer_Bilan 'Imprimer_comp 'Imprimer_Mana 'Imprimer_Obj 'Imprimer_formation 'Imprimer_Projet 'Imprimer_AG 'Imprimer_recours End Sub
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
49
50
51
52
53
54
55
56
57
58
59 Public Sub Imprimer_Evalué() ' Imprimer la feuille Evalué Dim i As Integer Efface_catfonct ' la procedure qui ne fonctionne pas voir code plus bas With Sheets("Evalué") For i = 1 To 15 With .OLEObjects("eva" & i).Object .BackColor = RGB(255, 255, 255) .SpecialEffect = fmSpecialEffectFlat .ShowDropButtonWhen = fmShowDropButtonWhenNever End With Next For i = 5 To 7 With .OLEObjects("nb" & i).Object .BackColor = RGB(255, 255, 255) .SpecialEffect = fmSpecialEffectFlat End With Next If .Visible = False Then .Visible = True End If .PageSetup.PrintArea = "$A$1:$H$59" .PrintOut Copies:=1 'impression If cache Then .Visible = False End If For i = 1 To 4 With .OLEObjects("eva" & i).Object .BackColor = RGB(233, 239, 250) .SpecialEffect = fmSpecialEffectSunken End With Next For i = 5 To 7 With .OLEObjects("nb" & i).Object .BackColor = RGB(233, 239, 250) .SpecialEffect = fmSpecialEffectSunken End With Next For i = 5 To 15 With .OLEObjects("eva" & i).Object .BackColor = RGB(233, 239, 250) .SpecialEffect = fmSpecialEffectSunken .ShowDropButtonWhen = fmShowDropButtonWhenAlways End With Next Range("a29,c29").Font.ColorIndex = 1 Range("a39,d39").Font.ColorIndex = 1 End With End Sub
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
49
50
51
52
53
54
55
56
57
58 Public Sub Efface_catfonct() 'Efface la catégorie ou la fonction 'catégorie Dim i As Integer With Sheets("Evalué") For i = 5 To 7 If .OLEObjects("eva" & i).Object.Value = "" Then With .OLEObjects("eva" & i).Object .BackColor = RGB(255, 255, 255) .SpecialEffect = fmSpecialEffectFlat .ShowDropButtonWhen = fmShowDropButtonWhenNever End With With .OLEObjects("nb" & i).Object .BackColor = RGB(255, 255, 255) .SpecialEffect = fmSpecialEffectFlat End With Range("a29,c29").Font.ColorIndex = 2 End If Next If .OLEObjects("eva2").Object.Value <> "" Then Range("a29").Font.ColorIndex = 1 End If If .OLEObjects("nb5").Object.Value <> "" Then Range("c29").Font.ColorIndex = 1 End If 'fonction For i = 8 To 13 If .OLEObjects("eva" & i).Object.Value = "" Then With .OLEObjects("eva" & i).Object .BackColor = RGB(255, 255, 255) .SpecialEffect = fmSpecialEffectFlat .ShowDropButtonWhen = fmShowDropButtonWhenNever End With End If If .OLEObjects("eva" & i).Object.Value = "" Then Range("a39,d39").Font.ColorIndex = 2 End If If .OLEObjects("eva5").Object.Value <> "" Then Range("a39").Font.ColorIndex = 1 End If If .OLEObjects("eva8").Object.Value <> "" Then Range("d39").Font.ColorIndex = 1 End If Next End With End Sub
Partager