Hi,
Could someone please give me some guidance with an issue I am having.
I'm trying to copy a range of data from one sheet, paste it to another, then insert and shift down one row.
The first example below works but if I'm working on another sheet it will always returns me to sheet two.
The second example I think is heading in the right direction(minus .Activate and .Select) but I don't how to incorporate the insert and shift down without encountering the issues of the first example.
Any help would be appreciated.
Thanks,
Simon
Sub example1()
Application.ScreenUpdating = False
Sheets("one").Activate
Sheets("one").Range("B5:Y5").Select
Selection.Copy
Sheets("two").Activate
Sheets("two").Range("B5:Y5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Application.ScreenUpdating = False
StartTimer
End Sub
Sub Example2()
Dim srceRng As Range
Dim destRng As Range
Set srceRng = Workbooks("ontimemacro.xlsm").Sheets("one").Range("B5:Y5")
Set destRng = Workbooks("ontimemacro.xlsm").Sheets("two").Range("B5:Y5")
srceRng.Copy
Workbooks("ontimemacro.xlsm").Sheets("two").Paste destRng
StartTimer
End Sub
Bookmarks