下面是我的代码,请您告诉我如何使用更改或重写以下代码
For y = 34 To 2 Step -1
If Cells(y, 8) = "" Then
Cells(y - 1, 8).Select
Selection.End(xlUp).Select
myFirstCell = ActiveCell.Address
Selection.End(xlDown).Select
myLastCell = ActiveCell.Address
Cells(y, 8).Select
ActiveCell.FormulaR1C1 = "=sum(myFirstCell" & ":myLastCell" & ")"
Else
End If
Next