PRoblème insolvable!

olhey

XLDnaute Occasionnel
j'ai fais une fonction pour afficher/masquer des connecteurs en fonction de leur couleur. tout fonctionne bien à part pour le dernier qui masque/affiche plusieurs type de formes automatiques...pourtant pas de la même couleur:confused:

Je suis à bout...c'est incompréhensible

Code:
'fonction pour afficher/masquer les liaisons de couleur
Sub AfficheLink(CodeCoul%)
Dim s As Object
For Each s In Feuil1.Shapes
If s.Name Like "AutoShape*" Then
If s.Line.ForeColor.SchemeColor = CodeCoul Then s.Visible = Not s.Visible
End If
Next
End Sub

'checkbox connexion
Private Sub CheckBox1_Click()
Call AfficheLink(60)
End Sub
Private Sub CheckBox2_Click()
Call AfficheLink(53)
End Sub
Private Sub CheckBox3_Click()
Call AfficheLink(52)
End Sub
Private Sub CheckBox4_Click()
Call AfficheLink(51)
End Sub
Private Sub CheckBox5_Click()
Call AfficheLink(61)
End Sub
Private Sub CheckBox6_Click()
Call AfficheLink(54)
End Sub
Private Sub CheckBox7_Click()
Call AfficheLink(46)
End Sub
[COLOR="Red"]Private Sub CheckBox8_Click()
Call AfficheLink(57)
End Sub[/COLOR]
 

Bebere

XLDnaute Barbatruc
Re : PRoblème insolvable!

bonjour
avec un fichier plus facile
essaye ce qui suit


Sub AfficheLink(CodeCoul%)
Dim s As Object, I As Byte
For Each s In Feuil1.Shapes
If s.Name Like "AutoShape*" Then
If s.Line.ForeColor.SchemeColor = CodeCoul Then s.Visible = Not s.Visible
End If
Next

For I = 1 To 8
Controls("CheckBox" & I) = False
Next I

End Sub
'checkbox connexion
Private Sub CheckBox1_Click()
If CheckBox1 = True Then Call AfficheLink(60)
End Sub
Private Sub CheckBox2_Click()
If CheckBox2 = True Then Call AfficheLink(53)
End Sub
Private Sub CheckBox3_Click()
If CheckBox3 = True Then Call AfficheLink(52)
End Sub
Private Sub CheckBox4_Click()
If CheckBox4 = True Then Call AfficheLink(51)
End Sub
Private Sub CheckBox5_Click()
If CheckBox5 = True Then Call AfficheLink(61)
End Sub
Private Sub CheckBox6_Click()
If CheckBox6 = True Then Call AfficheLink(54)
End Sub
Private Sub CheckBox7_Click()
If CheckBox7 = True Then Call AfficheLink(46)
End Sub
Private Sub CheckBox8_Click()
If CheckBox8 = True Then Call AfficheLink(57)
End Sub
à bientôt
 

Discussions similaires

Réponses
24
Affichages
2 K
Réponses
6
Affichages
443

Statistiques des forums

Discussions
312 489
Messages
2 088 848
Membres
103 973
dernier inscrit
okoazer