PasteSpecial函数在excel中不起作用

时间:2019-06-21 10:59:31

标签: excel vba

我需要制作一个粘贴数据的宏,当我记录宏时,每次都遇到相同的问题。我希望有人可以帮助我解决我的问题。

每次调试时,此功能都会遇到相同的问题:

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False

Range("AP5:AP43").Select
Selection.Clear
Range("AP5").Select
ActiveSheet.ListObjects("Table11").Range.AutoFilter Field:=4, Criteria1:="IT"

Range("C5:C51").Select
Selection.Copy
ActiveSheet.ListObjects("Table11").Range.AutoFilter Field:=4
Range("AP5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks 
    :=False, Transpose:=False
Application.CutCopyMode = False
ActiveSheet.Range("Table9[#All]").RemoveDuplicates Columns:=1, Header:= _
    xlYes
Range("Table9[Forecast på aktiviteter]").Select
With Selection.Interior
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    .ThemeColor = xlThemeColorAccent6
    .TintAndShade = 0.599993896298105
    .PatternTintAndShade = 0
End With
Range("AS29").Select

End Sub

0 个答案:

没有答案