Somme avec range

je souhaite ecrire une equation avec vba

A = .Range("S" & CELL.Row).Value
    B = .Range("V" & CELL.Row).Value
    C = .Range("X" & CELL.Row).Value

    .Range("W" & CELL.Row).Formula = A - (B + C)

le resultat est incoherent.

comment peut on ecrire une equation avec vba?

Bonjour,

Teste ceci

With ActiveSheet
    A = .Cells(ActiveCell.Row, "S").Value
    B = .Cells(ActiveCell.Row, "V").Value
    C = .Cells(ActiveCell.Row, "X").Value

    .Range("W" & ActiveCell.Row).Formula = A - (B + C)
  End With

Bonjour kerkenianes, le forum,

A quoi correspond CELL ?

Cordialement,

Bonjour xorsankukai
cell correspond a dune boucle for each cell in range......
merci

With Sheets("CMD_CLIENT")
Set plage = .Range("A21:A" & Dernligne)
For Each CELL In plage
 If CELL.Value = coderech Then
 If .Cells(CELL.Row, 9).Value = lblcodeart Then
If .Cells(CELL.Row, 17).Value <> "EA" Then
A = .Range("S" & CELL.Row).Value
    B = .Range("V" & CELL.Row).Value
    C = .Range("X" & CELL.Row).Value

    .Range("W" & CELL.Row).Formula = A - (B + C)
...........

bonjour M12

ca na pas marché

merci

Re,

A voir si cela peut t'aider.....

Sinon,

2classeur1.xlsm (20.20 Ko)

[EDIT] ....je viens de voir que tu as rajouté un code....

6classeur2.xlsm (18.51 Ko)

Cordialement,

merci xorsankukai

çà fonctionne parfaitement.

Rechercher des sujets similaires à "somme range"