Option Explicit
Sub prova()
Dim UR2 As Long, col As Long, RR1 As Integer, RR2 As Integer, somma As Double, y As Range
'UR2 = Worksheets("Foglio2").Range("d" & Rows.Count).End(xlUp).Row
UR2 = ActiveSheet.Cells(Rows.Count, 4).End(xlUp).Row
'UC = Worksheets("Foglio2").Range("t2").End(xlToLeft).Column
col = Range("A2").CurrentRegion.Columns.Count
'Determinazione del valore soglia H300, H310, H330, H341, H311, H331>=0,1%
For RR1 = 2 To UR2
For RR2 = 2 To col
Set y = Cells(RR1, RR2)
If y = "H300" Or y = "H310" Or y = "H330" Or y = "H301" Or y = "H311" Or y = "H331" Then
somma = somma + Cells(RR1, 1): Exit For
End If
Next
Next
Stop
End Sub
|