我声明了ColorCell变量并使用Set以便使用For循环进行一些颜色更改。
但是在编码时会引发错误,我无法解释调试说明。
Sub 계산()
Dim SumVariable As Integer
Dim i As Integer
Dim ColorCell As Range
Set ColorCell = Range("D" & i)
For i = 3 To Range("D14").End(xlUp).Row
If Cells(i, "D") > 300 Then
MsgBox ("haha!")
Cells(i, "D").Value = 10
Range("D4").CurrentRegion.Select
ColorCell.Interior.Color = vbYellow
End If
Next i
End Sub