forループ内にfor eachループがあり、for eachループは、現在の行のある列の値が配列に存在するかどうかをチェックし、存在する場合はforループで何をしたいのか、存在しない場合はしたいforループを続ける
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
私がやろうとしているのは、特定の ID を持つ行の計算を行い、配列にない ID を持つ行をスキップすることです。