guy72
XLDnaute Impliqué
Bonsoir
Comment faire démarrer cette macro avec une condition ?
Comme si je mettais cette fonction :
=Si(BE41=100 ;Alors Macro Cellule ; sinon "Blanc")
Ou un autre système qui puisse me permette de démarrer cette macro quand la cellule A1=100
Sub Cellule()
Dim sto As Boolean
boucl:
z = z + 1
For Each vcel In Range("b2:au2,b3:b48,c48:av48,av2:av47")
If vcel.Interior.ColorIndex = 6 Then
vcel.Interior.ColorIndex = 40
chgt = V
End If
Next
suite:
For X = 1 To 2000
Next X
For Each vcel In Range("b2:au2,b3:b48,c48:av48,av2:av47")
If vcel.Interior.ColorIndex = 40 Then
vcel.Interior.ColorIndex = 6
chgt = V
saut:
End If
Next
For X = 1 To 2000
Next X
If z > 10 Then Exit Sub
GoTo boucl
End Sub
Cordialement
Guy
Comment faire démarrer cette macro avec une condition ?
Comme si je mettais cette fonction :
=Si(BE41=100 ;Alors Macro Cellule ; sinon "Blanc")
Ou un autre système qui puisse me permette de démarrer cette macro quand la cellule A1=100
Sub Cellule()
Dim sto As Boolean
boucl:
z = z + 1
For Each vcel In Range("b2:au2,b3:b48,c48:av48,av2:av47")
If vcel.Interior.ColorIndex = 6 Then
vcel.Interior.ColorIndex = 40
chgt = V
End If
Next
suite:
For X = 1 To 2000
Next X
For Each vcel In Range("b2:au2,b3:b48,c48:av48,av2:av47")
If vcel.Interior.ColorIndex = 40 Then
vcel.Interior.ColorIndex = 6
chgt = V
saut:
End If
Next
For X = 1 To 2000
Next X
If z > 10 Then Exit Sub
GoTo boucl
End Sub
Cordialement
Guy