VBA错误对象不支持此对象或方法

时间:2017-01-23 12:32:18

标签: excel-vba vba excel

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

任何人都可以告诉我代码有什么问题,错误在哪里?

1 个答案:

答案 0 :(得分:1)

这里有语法错误:

Cells(i, 4).vlue = x应该是

Cells(i, 4).value = x