Given the code below. I'm trying to end the for loop as soon as the condition that the value TOTALE ORE has been found. I'm having a hard time figuring this out. Any help is much appreciated.
For Each source_total_hours In source_month.Resize(50, 2)
If source_total_hours.Value = "TOTALE ORE" Then 'Cerca TOTALE ORE
For Each source_hours In source_total_hours.Offset(0, 3).Resize(, 50)
If IsNumeric(source_hours) Then 'Aggiungi a lista ore se valore è numerico
hours_list.Add (source_hours)
End If
Next source_hours
End If
Next source_total_hours
Don't know where to end the loop with an Exit for or something similar.
Edit: I rephrase. I would like it to end after completing the cycle, but if if TOTALE ORE HAS BEEN FOUND don't look for another one and do the whole cycle again.
Edit 2: Nothing changes if I add after inner loop.
For Each source_total_hours In source_month.Resize(50, 2)
If source_total_hours.Value = "TOTALE ORE" Then 'Cerca TOTALE ORE
For Each source_hours In source_total_hours.Offset(0, 3).Resize(, 50)
If IsNumeric(source_hours) Then 'Aggiungi a lista ore se valore è numerico
hours_list.Add (source_hours)
End If
Next source_hours
Exit For
End If
Next source_total_hours