细胞types不匹配

我需要一个for循环来跳过一个索引值,我不明白为什么这个代码不会跳过循环中的第六个索引值。

Application.ScreenUpdating = False Exceptions = 0 Dim i As Long For i = 1 To Rows.Count If i <> 6 Then If (Cells(i, Selection.Column).Value - Cells(i + 1, Selection.Column).Value) > 0.1 And Cells(i, Selection.Column).Value > 90 Then MsgBox ("The ticker start value is: " & i - 6) Exit For End If End If If Cells(i, Selection.Column) = "" Then Exceptions = Exceptions + 1 End If If Exceptions > 8 Then MsgBox ("No start found") Exit For End If Next Application.ScreenUpdating = True 

我遇到的问题是,第六行包含文本和布尔在单元格上做math。 所以当循环到达第6行时,它会崩溃。 然而,这个循环继续崩溃,尽pipe没有处理任何东西在第六行。