Sub ClicClac()
With ActiveSheet
If .Shapes("Image 1").Visible = -1 And .Shapes("Image 2").Visible = -1 Then
.Shapes("Image 1").Visible = -1
.Shapes("Image 2").Visible = 0
ElseIf .Shapes("Image 1").Visible = -1 And .Shapes("Image 2").Visible = 0 Then
.Shapes("Image 1").Visible = 0
.Shapes("Image 2").Visible = -1
ElseIf .Shapes("Image 1").Visible = 0 And .Shapes("Image 2").Visible = -1 Then
.Shapes("Image 1").Visible = -1
.Shapes("Image 2").Visible = -1
End If
End With
End Sub
Sub Clique()
Dim etat
With ActiveSheet
etat = -.Shapes("image 1").Visible - .Shapes("image 2").Visible
Select Case etat
Case 0: .Shapes("image 1").Visible = True: .Shapes("image 2").Visible = True
Case 1: .Shapes("image 1").Visible = False: .Shapes("image 2").Visible = False
Case 2: .Shapes("image 1").Visible = False: .Shapes("image 2").Visible = True
End Select
End With
End Sub
Sub Suivant()
Const mesImages = "bateau;tresor;ancre;tetemort;jacquot" 'liste ordonnée des images
Dim s, i&
s = Split(mesImages, ";")
With ActiveSheet
For i = 0 To UBound(s)
If .Shapes(s(i)).Visible = True Then .Shapes(s(i)).Visible = False: Exit For
Next i
If i = UBound(s) + 1 Then For i = 0 To UBound(s): .Shapes(s(i)).Visible = True: Next
End With
End Sub
Sub clique2()
Dim MesImages, I&
Set MesImages = ActiveSheet.Shapes.Range(Array("bateau", "tresor", "ancre", "tetemort", "jacquot")) 'collection shapes.range des images
For I = 1 To MesImages.Count + 1
If I > MesImages.Count Then MesImages.Visible = True: Exit For
If MesImages(I).Visible = True Then MesImages(I).Visible = False: Exit For
Next I
End Sub
Sub clique3()
Static x As Long
Dim MesImages
Set MesImages = ActiveSheet.Shapes.Range(Array("bateau", "tresor", "ancre", "tetemort", "jacquot")) 'collection shapes.range des images
x = x + 1: If x = MesImages.Count + 1 Then x = 0
MesImages.Visible = True
If x > 0 Then MesImages(x).Visible = False
End Sub
Sub clique4()
Static x As Long
Dim MesImages
Set MesImages = ActiveSheet.Shapes.Range(Array("bateau", "tresor", "ancre", "tetemort", "jacquot")) 'collection shapes.range des images
x = x + 1
If x > MesImages.Count Then MesImages.Visible = True: x = 0: Exit Sub
MesImages(x).Visible = False
End Sub
Sub clique4()
Dim Shp As Shape, DernVis As Boolean
For Each Shp In ActiveSheet.Shapes.Range(Array("bateau", "tresor", "ancre", "tetemort", "jacquot"))
DernVis = Shp.Visible
Shp.Visible = Not DernVis
If DernVis Then Exit Sub
Next Shp
End Sub