数组的偏移范围

时间:2020-02-24 18:46:17

标签: excel vba

因此,关于上一个问题,我试图摆脱数组的困扰,但我不太了解它们。

在此示例中,为什么我不能执行with命令?它给我一个错误,要求有一个对象

Dim aRng As Variant
aRng = Range("A4:A" & Cells(Rows.Count, "A").End(xlUp).Row)
aRng = Application.WorksheetFunction.Transpose(aRng)

    'Copy Arng to Col C, and remove duplicates
    With aRng
        .Copy .Offset(, 2)
        .Offset(, 2).RemoveDuplicates Columns:=1, Header:=xlNo
        With aRng.Offset(, 2)
        If WorksheetFunction.CountA(.Cells) > 0 Then .SpecialCells(xlCellTypeBlanks).Delete Shift:=xlShiftUp
    End With
End With

0 个答案:

没有答案
相关问题