我已经编写了以下仅适用于我的 excel 的 Sheet1 的代码现在我想将这段代码移动到我的 VBA 的模块部分。请指教。
代码是这样的:
Private Sub ReviewCheck()
Dim i, val1, val2
For i = 1 To UsedRange.Rows.Count
val1 = UCase(Cells(i, "A").Value)
If ((InStr(val1, "ABC")) Or (InStr(val1, "XYZ")) Or (InStr(val1, "123"))) > 0 Then
If UCase(Cells(i, "B").Value) = "N" Then
'Cells(i, "C").Value = False
Cells(i, "A").Interior.ColorIndex = 3
ElseIf UCase(Cells(i, "B").Value) = "Y" Then
'Cells(i, "C").Value = True
Cells(i, "B").Interior.ColorIndex = xlNone
Else
'Cells(i, "C").Value = False
Cells(i, "B").Interior.ColorIndex = 6
End If
Else
Cells(i, "B").Interior.ColorIndex = xlNone
End If
Next i
End Sub