Copy the row multiple times while translating the columns

A

Anamik

Hi,

I want to copy each row in the file 3 times one after another. The second
copy should be translated one column to the left and the third copy two
columns to the left. For example, suppose I copy the rows
a b c
d e f
They should look like
a b c
a b c
a b c
d e f
d e f
d e f
Thank you very much in advance.
Anamik.
 
M

Mark

Hi,
There is no error checking in this. if the start range is
in column A or B then an error will occur.

Public Sub CopyData3()
Range("E1").Select
Set a = Selection
Range(a, a.End(xlToRight)).Select
Set x = Selection
x.Copy
a.Offset(1, -1).Select
Set a = Selection
ActiveSheet.Paste
a.Offset(1, -1).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub


- mark
http://www.geocities.com/excelmarksway
 
A

Anamik

Mark said:
Hi,
There is no error checking in this. if the start range is
in column A or B then an error will occur.

Public Sub CopyData3()
Range("E1").Select
Set a = Selection
Range(a, a.End(xlToRight)).Select
Set x = Selection
x.Copy
a.Offset(1, -1).Select
Set a = Selection
ActiveSheet.Paste
a.Offset(1, -1).Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub


- mark
http://www.geocities.com/excelmarksway
Thank you Mark. The problem is only the first line is written thrice and
then all others are deleted. I am a newbie so can you please check it and
tell me what needs to be changed.

Thank you very much in advance.
Anamik.
 
Top