1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
Sub prorata()
'
' prorata Macro
' affichage colonne prorata
'
Dim s As Integer, var As Integer, cel As Range
Dim i As Integer, j As Integer, k As Integer, x As String, y As String
i = 13
Do While Cells(i, 2).Value <> ""
s = 0
For j = i To Cells(Rows.count, 1).End(xlUp).Row
var = Cells(j, 3).Value
s = s + var
If Cells(j, 1).Value Like "DP*" Then
Cells(j, 4).Value = s
Cells(j, 4).Select
Selection.Font.Bold = True
Exit For
End If
Next
k = j
For j = i To k
x = Cells(j, 3).Value
Cells(j, 5).Value = x & " \" & s
Next
i = j - 1
i = i + 1
Loop
End Sub |
Partager