Private Sub Worksheet_Change qui boucle
bonjour,
je viens de taper le code ci-dessous, mais quand je change la valeur de "G18" la macro boucle et ferme mon classeur Excel.
qu'ais je mal saisi ? sachant que ce code fonctionne très bien en "Private Sub Worksheet_BeforeDoubleClick"
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("G18") Then
Dim chimney As String
chimney = 0
axeOY:
chimney = chimney + 1
ActiveSheet.Range("D25").FormulaR1C1 = chimney
If ActiveSheet.Range("G25").Value < ActiveSheet.Range("G12").Value Then GoTo axeOY
chimney = chimney - 1
ActiveSheet.Range("D25").FormulaR1C1 = chimney
End If
End Sub |
d'avance merci