我想複製和粘貼動態範圍。特別是對每個複製範圍源粘貼重複值。下面是代碼,我從錄製宏創建:複製動態範圍並粘貼具有重複值的動態範圍
Sub copyRange()
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Range("L2:S7").Select
ActiveSheet.Paste
Range("A3").Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.Copy
Range("L8:S13").Select
ActiveSheet.Paste
Range("A4").Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.Copy
Range("L14:S19").Select
ActiveSheet.Paste
Range("A5").Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.SmallScroll Down:=3
Range("L20:S25").Select
ActiveSheet.Paste
End Sub
這是截圖輸出,我想:
感謝Prasar Khode改正我的queston –