| A | B | C | D | E | F |
1 | giallo | 12 | giallo | 6 | giallo | 9 |
2 | giallo | 2 | giallo | 53 | | 3 |
n | giallo | 20 | giallo | 12 | giallo | 21 |
... | | 32 |
grazie
Capito poco poco.
Prova:
Public Sub m()
Dim sh As Worksheet
Dim c As Range
Dim rng As Range
Dim lCont As Long
Dim lng As Long
Dim dTot As Double
Dim lUltRiga As Long
dTot = 0
lCont = 0
Set sh = Worksheets("Foglio1")
With sh
lUltRiga = _
.Range("B" & _
Rows.Count).End(xlUp).Row
For lng = 1 To lUltRiga
Set rng = _
.Range("A" & lng & ":E" & lng)
For Each c In rng
If c.Interior.ColorIndex = _
6 Then
lCont = lCont + 1
End If
Next
If lCont = 3 Then
dTot = dTot + .Cells(lng, 2).Value
End If
lCont = 0
Next
.Range("B" & lUltRiga + 1).Value = dTot
End With
Set c = Nothing
Set rng = Nothing
Set sh = Nothing
End Sub
Non testata.
Non funziona se il colore è dato da una
formattazione condizionale.
--
---------------------------
Mauro Gamberini
http://www.riolab.org/
Grande! funziona perfettamente.
Grazie
prapra