For r = 0 To ROWS - 1 Dim c = 0 Do While c <= COLS - 1 Dim val = nums(r, c) Console.WriteLine(val) If val = 20 Then Exit For c += 1 Loop Next