我想在For语句中的B列中动态选择一个单元格。
然而我得到: "应用程序定义或对象定义的错误"
我该如何正确地做到这一点?
For i = 1 To 30
Sheets("Back").Range(Cells(i + 3, 2)).Select
Select Case ActiveCell.Value
Case "3"
Sheets("Back").Cells(i + 3, 2).Value = "Good"
Case "8"
Sheets("Back").Cells(i + 3, 2).Value = "Bad"
Case Else
Sheets("Back").Cells(i + 3, 2).Value = ""
End Select
Next i
答案 0 :(得分:0)
试试这个:
对于i = 1到30
Sheets("Back").Cells(i + 3, 2).Select
Select Case ActiveCell.Value
Case "3"
Sheets("Back").Cells(i + 3, 2).Value = "Good"
Case "8"
Sheets("Back").Cells(i + 3, 2).Value = "Bad"
Case Else
Sheets("Back").Cells(i + 3, 2).Value = ""
End Select
接下来我