1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Sub AjoutEtat()
Dim DerLig As Long, r As Long
Dim Ws As Worksheet
Set Ws = Sheets("sheet1")
DerLig = Ws.Cells(Columns(2).Cells.Count, 2).End(xlUp).Row
Ws.Columns(6).ClearContents
For r = 3 To DerLig
Ws.Cells(2, 6) = "Evol"
If Ws.Cells(r, 5) = "" Then Ws.Cells(r, 6) = "Obsolete"
If Ws.Cells(r, 4) = "" Then Ws.Cells(r, 6) = "Nouveau"
If Ws.Cells(r, 4) <> "" And Ws.Cells(r, 5) <> "" And Ws.Cells(r, 5) > Ws.Cells(r, 4) Then Ws.Cells(r, 6) = "'+ " & Round(((Ws.Cells(r, 5) - Ws.Cells(r, 4)) / Ws.Cells(r, 4)), 2) * 100 & " %"
Next r
End Sub |
Partager