Copying a range

P

pcor

I want to select a given range and copy that range to 4 places:
Lets say I select a1 to e8
I want the macro to copy the selected information 4 times as
follows:
to a9:e16
a17:e24
a25: e32
F1:J8
In other words. Copy the selected data three times just below the
selected data and once to the right of the selected data.
Most appreciated and Merry Xmas to all
Ian M
 
P

Per Jessen

This macro assume that the column right to the selection is empty, the
same goes for the rows below the selection:

Sub CopyRng()
Dim TargetRng As Range
Set TargetRng = Selection
TargetRng.Copy TargetRng.End(xlToRight).Offset(0, 1)
For r = 1 To 3
TargetRng.Copy TargetRng(1, 1).End(xlDown).Offset(1)
Next
End Sub

Regards,
Per
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top