Division de deux colonnes

Bonjour a tous

jai une petite question comment faire la division entre deux colonne

Pour une cellule je fais:

[E1].Value = [D1].Value / [C1].Value

mais comment faire si je veux tt la colonne donc

[E1].Value = [D1].Value / [C1].Value
[E2].Value = [D2].Value / [C2].Value
[E3].Value = [D3].Value / [C3].Value
.....

merci de votre aide

Bonjour,

Une boucle !

bonjour,

une possibilité :

Sub test()
Dim Nbligne, i
Nbligne = 3
For i = 1 To Nbligne
Cells(i, 5) = Cells(i, 4) / Cells(i, 3)
Next
End Sub

A+

mercii bcpp


 Cells(i, 5) = Cells(i, 4) / Cells(i, 3)

sa me donne erreur 13


Sub Taux_Accp()

    Dim Sinistre_Accepte As Range
    Dim Sinistre_Declare As Range
    Dim DernLigne As Long
    Dim i As Integer

    With Worksheets("Feuil4")
        DernLigne = .Range("A" & .Rows.Count).End(xlUp).Row
        Set Sinistre_Accepte = .Range("D2:D" & DernLigne)
        Set Sinistre_Declare = .Range("C2:C" & DernLigne)
    End With

    For i = 1 To DernLigne
        Cells(i, 5) = Cells(i, 4) / Cells(i, 3)
    Next i

End Sub

je crois que le pb c'est que

Cells(i, 3)

prend 0 comme valeurs du coupp je sais pas comment faire

If Cells(i, 3) > 0 then...

il me met tjrs erreur 13

Sub Taux_Accp()

    Dim Sinistre_Accepte As Range
    Dim Sinistre_Declare As Range
    Dim DernLigne As Long
    Dim i As Integer

    With Worksheets("Feuil4")
        DernLigne = .Range("A" & .Rows.Count).End(xlUp).Row
        Set Sinistre_Accepte = .Range("D2:D" & DernLigne)
        Set Sinistre_Declare = .Range("C2:C" & DernLigne)
    End With

'Total = Nombre_Sinistre_Accepte / Nombre_Sinistre_Declare

    For i = 1 To DernLigne
        If Cells(i, 3) > 0 Then
            Cells(i, 5).Value = Cells(i, 4).Value / Cells(i, 3).Value
        End If
    Next i

End Sub

c'est bon sa marche mercii je devais juste que je commence la boucle for a partir de 2

For i = 2 To DernLigne

OUI MERCI

Rechercher des sujets similaires à "division deux colonnes"