Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Copying a range

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Copying a range

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

On 22 Dec., 16:14, pcor wrote:
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which is faster, copying range to another set of ranges or copying tomemory? axwack Excel Programming 2 December 12th 07 01:19 PM
Copying Range Based On Certain Criteria? Possible looping through the Range Big H Excel Programming 1 October 27th 06 03:32 AM
Copying a range to a new tab Andy Excel Programming 0 January 9th 06 04:45 AM
copying dynamic range based on cell outside of range xcelelder Excel Programming 3 September 29th 05 05:08 PM
Searching a range and copying values into a new range.... **Please help** :( Lancia Excel Programming 1 September 29th 04 01:08 PM


All times are GMT +1. The time now is 06:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"