Private Sub CommandButton53_Click() Sheets("Sheet1").Select For i = 2 To 65536 Dim y, z, x y = Range("D" & i).Value z = Range("F" & i).Value If (y "" And z "") Then Exit For End If x = y / z Range("R" & i) = x * 100 Next i End Sub
Private Sub CommandButton53_Click() Sheets("Sheet1").Select For i = 2 To 65536 Dim y, z, x y = Range("D2" & i).Value z = Range("F2" & i).Value x = y / z Range("R2" & i) = x * 100 Next i
Private Sub CommandButton53_Click() Dim y, z, i i = 2 y = Range("D" & i).Value z = Range("F" & i).Value Sheets("Sheet1").Select 'Tant que les deux colonnes ne sont pas vides, on effectue le traitement While (y <> "" Or z <> "") 'Si le diviseur est vide ou egal à 0, on ne fait pas la division (division impossible par 0) If (z <> "" And z <> 0) Then 'Si y est vide, on remplace la valeur par 0 If (y = "") Then y = 0 End If 'On ajoute la valeur du calcul à la cellule de la même ligne Range("R" & i) = (y / z) * 100 End If 'On incrémente le compteur i = i + 1 'On modifie les prochaine valeur à calculer y = Range("D" & i).Value z = Range("F" & i).Value Wend End Sub
Range("R" & i) = (y / z) * 100
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionSheets("Sheet1").Range("R" & i).value = (y / z) * 100
You specified a name that is in the type library, but it is marked as hidden. You cannot normally view hidden type library members. Choose Show Hidden Members on the object browser context menu to make hidden members visible. You can then view the member information.
Private Sub CommandButton53_Click() Sheets("Sheet1").Select Dim y, z, x y = Range("D2" & i).Value z = Range("F2" & i).Value If (y "" And z "") Then exit for end if x = y / z Range("R2" & i) = x * 100 Next i End Sub
Private Sub CommandButton53_Click() Sheets("Sheet1").Select For i = 2 To 65536 Dim y, z, x y = Range("D2" & i).Value z = Range("F2" & i).Value If (y "" And z "") Then Exit For End If x = y / z Range("R2" & i) = x * 100 Next i