Non sono sicuro di aver utilizzato dropbox nel modo corretto perciò allego immagine del file e della funzione

Grazie.Saluti
R
Moderatori: Anthony47, Flash30005
Function SommaCellePerColore(rData As Range, cellRefColor As Range)
Dim indRefColor As Long
Dim cellaCorrente As Range
Dim sumRes, noVal As Boolean
'
Application.Volatile
sumRes = 0
indRefColor = cellRefColor.Cells(1, 1).Interior.Color
For Each cellaCorrente In rData
If indRefColor = cellaCorrente.Interior.Color Then
sumRes = WorksheetFunction.Sum(cellaCorrente, sumRes)
noVal = False
Else
noVal = True
End If
Next cellaCorrente
If noVal Then
SommaCellePerColore = ""
Else
SommaCellePerColore = sumRes
End If
End Function
Function CheckSoglia(ByRef myRan As Range, ByRef myCol As Range, ByVal myThr As Double) As String
Dim myC As Range, tarCol As Long, mySum As Double
tarCol = myCol.Interior.Color
For Each myC In myRan
If myC.Interior.Color = tarCol Then
mySum = mySum + myC.Value
If mySum >= myThr Then Exit For
End If
Next myC
If Not myC Is Nothing Then CheckSoglia = myC.Address(0, 0)
End Function
=CheckSoglia(B2:B12;F1;3)
Supero = CheckSoglia(Sheets("Foglio1").Range("B2:B10000"), Sheets("Foglio1").Range("D2"), 3)
Torna a Applicazioni Office Windows
Disattivazione funzione " Telemetria " in W 10 Autore: mastino46 |
Forum: Software Windows Risposte: 5 |
Visitano il forum: Nessuno e 22 ospiti