我试图编写一个处理数据但跳过符合特定条件的数据点的宏。这是我的代码的简化版本:
Set gData = ThisWorkbook.Sheets("Dashboard").Range("E3:E16")
For Each cell In gData
Select Case cell.Value
Case Is = 20
Next cell 'error thrown here
Case Is > 20
'Do stuff
End Select
Next
编译器抛出一个" Next没有For"上述位置的错误。我还没能找到解决这个问题的有效方法。请帮忙!
答案 0 :(得分:3)
Set gData = ThisWorkbook.Sheets("Dashboard").Range("E3:E16")
For Each cell In gData
Select Case cell.Value
Case Is > 20
'Do stuff
End Select
Next