Excel用VBA将结果选择性粘贴后如何

2024-12-04 09:43:38
推荐回答(3个)
回答1:

在最后添加一句代码就行Application.CutCopyMode = False:
Sub bbb()
Dim rC As Range
With Sheets("斜三连")
For Each rC In .Range("I88:I99")
.Range("B1") = rC
.Range("J73:HB73").Copy
rC.Offset(0, 1).PasteSpecial Paste:=xlPasteValues
Next
End With
Application.CutCopyMode = False
End Sub

回答2:

在End Sub前加一句

Application.CutCopyMode = xlCopy

就可以清除剪贴板

附件已上

回答3:

Sub macro3()
Dim i As Range
For sh = 1 To Sheets.Count
For Each i In Sheets(sh).UsedRange.SpecialCells(xlCellTypeFormulas, 23)
If i.Formula Like "*" Then i = i + 1
Next
Next
End Sub

试试这个