Copying data from one sheet to another

Closed
mitochondria - Apr 29, 2011 at 03:21 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Apr 30, 2011 at 01:31 AM
Hello,

Macro newbie here. I'm trying to copy 351 rows of data from one sheet and paste the data to every 14th line on another sheet. Help!

DR

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Apr 30, 2011 at 01:31 AM
try this macro "test"( "undo" is to clear sheet2 for retesting "test")

Sub test() 
Dim r As Range, c As Range 
Worksheets("sheet1").Activate 
Set r = Range(Range("A1"), Range("A1").End(xlDown)) 
For Each c In r 
c.EntireRow.Copy 
With Worksheets("sheet2") 
.Cells(Rows.Count, "A").End(xlUp).Offset(14, 0).PasteSpecial 
End With 
Next c 
With Worksheets("sheet2") 
.Range("A1:A14").EntireRow.Delete 
End With 

End Sub


Sub undo() 
 Worksheets("sheet2").Cells.Clear 

End Sub
0