Sub addempty()
Dim i As Integer
Dim j As Integer
Dim x As Integer
For i = 3 To 300
x = 0
j = i - 1
If Cells(i, 2).Value = "FX" And Not IsEmpty(Cells(i - 1, 1).Value) Then
Do While Cells(j, 4).Value <> ""
x = Cells(j, 4).Value + x
j = j - 1
Loop
End If
Cells(i, 4).vlue = x
Next i
End Sub
任何人都可以告诉我代码有什么问题,错误在哪里?
答案 0 :(得分:1)
这里有语法错误:
Cells(i, 4).vlue = x
应该是
Cells(i, 4).value = x