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
|
Sub MWA()
Dim d As Range, STD As Range
Dim cmpt, scmpt, kcmpt
For Each d In STD.Range("D4:D800")
If Right(d.Value, 4) = "bnis" Then
d.Offset(0, 11) = cmpt
d.Offset(0, 5) = scmpt
d.Offset(0, 7) = kcmpt
d.Offset(0, 11).Font.Bold = True
d.Offset(0, 5).Font.Bold = True
d.Offset(0, 7).Font.Bold = True
d.Font.Bold = True
d.EntireRow.Interior.Color = 13160660
With d.EntireRow.Borders
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = 48
End With
cmpt = 0
scmpt = 0
kcmpt = 0
Else
cmpt = cmpt + d.Offset(0, 11).Value
scmpt = scmpt + d.Offset(0, 5).Value
kcmpt = kcmpt + d.Offset(0, 7).Value
End If
Next
End Sub |
Partager