对象不支持这个属性vba
'Copy and Paste the format of table With wb.Sheets("Sheet1").UsedRange .Copy End With Set cell = ActiveSheet.Range("C" & Rows.Count).End(xlUp) cell.Offset(3, 3).Activate With wbTarget.Sheets(I).ActiveCell .PasteSpecial End With
在第三段,它给了我错误。 我想将我复制的内容粘贴到activecell中。
我怎样才能解决这个问题? 谢谢
如果我明白你想用你的代码实现,我认为ActiveSheet
也是wbTarget.Sheets(I)
(我希望)。
所以replace你的:
Set cell = ActiveSheet.Range("C" & Rows.Count).End(xlUp) cell.Offset(3, 3).Activate With wbTarget.Sheets(I).ActiveCell .PasteSpecial End With
附:
With ActiveSheet Set cell = .Range("C" & .Rows.Count).End(xlUp) cell.Offset(3, 3).PasteSpecial End With
注意 :您应该远离ActiveSheet
并改用Worksheets("SheetName")
。