Pierro93 m'a concoté ce code qui fonctionne à merveille, mais j'avais oublié un truc important. Ce code fonctionne en colonne et je souhaite le faire fonctionner en Ligne.
La fonction Target.Ligne n'existe pas ? comme Target.Column ...
Option Explicit
Public b As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
If b = True Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target.Address = Range("Taux").Address Then maprocedure
If Target.Column > 2 And Target.Column < 9 Then
b = True
If Target.Column Mod 2 = 1 Then
Target.Offset(0, 1) = Target * (1 + Range("Taux") / 100)
Else
Target.Offset(0, -1) = Target / (1 + Range("Taux") / 100)
End If
b = False
End If
End Sub
Sub maprocedure()
Dim c As Range, i As Byte
b = True
For i = 3 To 7 Step 2
For Each c In Cells(2, i).Resize(Cells(65536, i).End(xlUp).Row - 1)
c.Offset(0, 1) = c * (1 + Range("Taux") / 100)
Next c
Next i
b = False
End Sub
La fonction Target.Ligne n'existe pas ? comme Target.Column ...
Option Explicit
Public b As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
If b = True Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target.Address = Range("Taux").Address Then maprocedure
If Target.Column > 2 And Target.Column < 9 Then
b = True
If Target.Column Mod 2 = 1 Then
Target.Offset(0, 1) = Target * (1 + Range("Taux") / 100)
Else
Target.Offset(0, -1) = Target / (1 + Range("Taux") / 100)
End If
b = False
End If
End Sub
Sub maprocedure()
Dim c As Range, i As Byte
b = True
For i = 3 To 7 Step 2
For Each c In Cells(2, i).Resize(Cells(65536, i).End(xlUp).Row - 1)
c.Offset(0, 1) = c * (1 + Range("Taux") / 100)
Next c
Next i
b = False
End Sub