i have a for each loop inside a for loop, the for each loop checks if a value in some column in the current row exists in an array, if it exists i want to do whats in the for loop and if it doesnt exist i want to continue the for loop
for i = 0 To DataGridView1.RowCount - 1
For Each id In IDs
If (DataGridView1.Item(1, i).Value <> id) Then
'continue the for loop, by continue i mean using continue statement and not executing the outer for loop for this case
End If
Next
'do for loop things
Next
what i am trying to do is to do calculations for the rows that have a specific id and skip the rows with the ids that are not in the array.
Do you want to “do for loop things” only if there is a match? Why not just like this?
Could be improved by creating more methods