【发布时间】:2016-12-16 12:00:56
【问题描述】:
Sub Worksheet_Change()
Set Target = ActiveCell
Application.ScreenUpdating = False
[A1:F20].Copy
[H4].PasteSpecial Paste:=xlPasteValues, Transpose:=True
[A22:F42].Copy
[H24].PasteSpecial Paste:=xlPasteValues, Transpose:=True
[A44:F64].Copy
[H46].PasteSpecial Paste:=xlPasteValues, Transpose:=True
[A66:F86].Copy
[H68].PasteSpecial Paste:=xlPasteValues, Transpose:=True
[A88:F108].Copy
[H90].PasteSpecial Paste:=xlPasteValues, Transpose:=True
[A110:F130].Copy
[H112].PasteSpecial Paste:=xlPasteValues, Transpose:=True
[A132:F152].Copy
[H134].PasteSpecial Paste:=xlPasteValues, Transpose:=True
[A154:F174].Copy
[H156].PasteSpecial Paste:=xlPasteValues, Transpose:=True
[A176:F196].Copy
[H178].PasteSpecial Paste:=xlPasteValues, Transpose:=True
[A198:F218].Copy[H200].PasteSpecial Paste:=xlPasteValues, Transpose:=True
Application.CutCopyMode = False
Target.Select
End Sub
【问题讨论】:
-
请通过缩进四个空格来格式化您的代码;它将在您的帖子中显示为代码而不是文本的一部分。另外,您的问题是指一个循环,但我在代码中没有看到任何循环?
-
我想在我反复写过 copy 和 pasteSpecial 的地方应用循环