读取连续的第一个单元格并转到下一个VBS

假设我有以下VBS代码:

For Each cell in Sheet.UsedRange.Cells If IsNumeric(cell) Then i = i + 1 If i = 1 Then ' get the first occurrence of the cell in a row ' finish code 

我希望获得第一个单元格是连续的数字,忽略当前行中的剩余单元格,然后移动到下一行。 我知道这与存储当前行(cell.Row)的值有关,但我无法弄清楚这个情况。

任何帮助是极大的赞赏。

 Sub findFristNumber() Dim r As Integer, c As Integer Dim cellValue r = Sheet1.UsedRange.Rows.Count c = Sheet1.UsedRange.Columns.Count For i = 2 To r For j = 1 To c cellValue = Cells(i, j) If IsNumeric(cellValue) Then MsgBox cellValue Exit For End If Next j Next i End Sub