合并方法-VBA

时间:2019-02-12 14:09:22

标签: excel vba

亲爱的

我正面临合并方法的问题。我在网上收到运行时错误1004:

.Consolidate Sources:=ArrSource, Function:=xlSum, _
   TopRow:=False, LeftColumn:=True, CreateLinks:=False

。下面是我的代码:

Option Explicit

Sub test1()

    Dim ArrSource As Variant

    With ThisWorkbook.Worksheets("Sheet1")

        ArrSource = .Range("A1:B20")

        With .Range("D1")
            .Consolidate Sources:=ArrSource, Function:=xlSum, _
                TopRow:=False, LeftColumn:=True, CreateLinks:=False
        End With

    End With

End Sub

有什么想法吗?

0 个答案:

没有答案
相关问题