【发布时间】:2018-07-05 12:37:00
【问题描述】:
下面是我的代码。所有代码都有效,但我得到错误 438 object does not support this property or method vba in this line。 i.offset(-7,-8).paste
Sub insert_6_rows()
Dim rActive As Range
Dim wb As Workbook
Set rActive = ActiveCell
Application.ScreenUpdating = False
Dim f As Range
Set f = Sheets("Format").Range("A1:J6")
Dim FindST As Range
Set FindST = Sheets("Driver").Range("I:I").Find(What:="Subtotal", LookIn:=xlValues)
FindST.Offset(-1, 0).EntireRow.Resize(6).Insert
f.Copy
Dim i As Range
Set i = Sheets("Driver").Range("I:I").Find(What:="Subtotal", LookIn:=xlValues)
i.Offset(-7, -8).Paste
rActive.Select
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
【问题讨论】:
-
我在 i.Offset(-7, -8).PasteSpecial 之前将 f.copy 向下移动了 3 行。现在可以使用了