Copy and paste

le888

Registered User.
Local time
Yesterday, 21:24
Joined
Dec 10, 2003
Messages
344
Hi,

I have create a macro by save all the steps that I want do to. So, I can see what are the codes behide. Unfortually, I repete manually the same step and the code is very long. So, I wonder if someone can rewrite the code more compact and more flexible. The following code comes from the excel macro wizard.

Code:

Rows("60:60").Select
Selection.Copy
Sheets("Feuil12").Select
ActiveSheet.Paste
Sheets("Feuil11").Select
Rows("59:59").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feuil12").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("Feuil11").Select
Rows("58:58").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feuil12").Select
Range("A3").Select
ActiveSheet.Paste
Sheets("Feuil11").Select
Rows("57:57").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feuil12").Select
Range("A4").Select
ActiveSheet.Paste
Sheets("Feuil11").Select
Rows("56:56").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feuil12").Select
....

Sheets("Feuil11").Select
Rows("120:120").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feuil12").Select
Range("A60").Select
ActiveSheet.Paste

Thanks,

Le
 
Hello!

Could you please explain what do you want to do? I can see that you are trying to copy data from one sheet to another. Is the data you are copying in fixed range? Please explain and attach the file.
If it`s a simple copy of data (and I think it is!), you can use this:

Sub le888()
ActiveWorkbook.Sheets("Feuil11").UsedRange.Copy
ActiveWorkbook.Sheets("Feuil12").Paste
End Sub

If you only knew the power of the dark side!
 
Last edited:
I want is to copy the last row (ex. row 60) of "sheet1" and past to the first row of "sheet2", copy the before last row (ex. 59) and paste to the second row of the "sheet 2". etc.. See The attachement.

Thanks,

Le
 

Attachments

Sounds like you want to invert the rows , so why not copy rows 1-60 of sheet1 to sheet2 , insert a col , fill down with1 -60, sort descending based on that col, delete the col.

Brian
 
Thanks, not a bad idea !!! ;)


Le
 
Use record macro when you do that and you`ll get the idea. It`s the easiest way!
 

Users who are viewing this thread

Back
Top Bottom