Dim i As Integer
For i = int_start To 1 Step -1
If InStr(rng_delete.Cells(i), "VALUE") > 0 Then
rng_delete.Cells(i).EntireRow.Delete()
End If
Next i
未处理的类型' System.InvalidCastException'发生在Microsoft.VisualBasic.dll 附加信息:从类型'范围'转换输入' String'无效。
答案 0 :(得分:1)
您需要指定要传递给InStr的单元格的哪个属性(通常为.Value或.Text)。
If InStr(rng_delete.Cells(i).Text, "VALUE") > 0 Then