B
benj78
Guest
Bonjour,
j'ai un exercice , que j'ai fais, mais j'aimerais avoir juste une petite précision
(voici lexo : Exercice 4
Plusieurs notes sont enregistrées dans la plage de cellules B1:B10. Ecrire une procédure qui calcule les notes définitives et les affecte à la plage C1:C10, selon la règle suivante :
Si note <= 7, note reste inchangée
Si 8<=note <=12, note est augmentée de 2 points
Si 13 <= note <=17, note est augmentée de 1 point
Si note >=18, note reste inchangée)
j'ai fais:
Sub note()
Dim ligne As Integer
For ligne = 1 To 10
If Cells(ligne, 2) >= 7 Then
Cells(ligne, 3) = Cells(ligne, 2)
ElseIf Cells(ligne, 2) >= 8 And Cells(ligne, 2) <= 12 Then
Cells(ligne, 3) = Cells(ligne, 2) + 2
ElseIf Cells(ligne, 2) >= 13 And Cells(ligne, 2) <= 17 Then
Cells(ligne, 3) = Cells(ligne, 2) + 1
ElseIf Cells(ligne, 2) >= 18 Then
Cells(ligne, 2) = Cells(ligne, 2)
End If
Next
End Sub
ca fonctionne, mais j'aimerais savoir quand est ce que l'on met "Cells(i,j).value.", ici j'aurai plus rajouter "value" ca ne changerait rien ?
j'ai un exercice , que j'ai fais, mais j'aimerais avoir juste une petite précision
(voici lexo : Exercice 4
Plusieurs notes sont enregistrées dans la plage de cellules B1:B10. Ecrire une procédure qui calcule les notes définitives et les affecte à la plage C1:C10, selon la règle suivante :
Si note <= 7, note reste inchangée
Si 8<=note <=12, note est augmentée de 2 points
Si 13 <= note <=17, note est augmentée de 1 point
Si note >=18, note reste inchangée)
j'ai fais:
Sub note()
Dim ligne As Integer
For ligne = 1 To 10
If Cells(ligne, 2) >= 7 Then
Cells(ligne, 3) = Cells(ligne, 2)
ElseIf Cells(ligne, 2) >= 8 And Cells(ligne, 2) <= 12 Then
Cells(ligne, 3) = Cells(ligne, 2) + 2
ElseIf Cells(ligne, 2) >= 13 And Cells(ligne, 2) <= 17 Then
Cells(ligne, 3) = Cells(ligne, 2) + 1
ElseIf Cells(ligne, 2) >= 18 Then
Cells(ligne, 2) = Cells(ligne, 2)
End If
Next
End Sub
ca fonctionne, mais j'aimerais savoir quand est ce que l'on met "Cells(i,j).value.", ici j'aurai plus rajouter "value" ca ne changerait rien ?