Macro to copy and paste.

bloubul

Member
Hi
I'm in search for a macro to copy every row on sheet 2 and paste it in every nth row on sheet 1
Currently I do it by hand but it is very time consuming.
What I'm looking for is displayed in red on sheet 1.

The lay out will always be the same, the range will vary from 36 rows to 69 rows, thus I must be able to change the every "Nth" row so that it paste correctly.
Copy row 1 on sheet 2 and paste it on nth row on sheet 1

Thank you in advance

https://www.mediafire.com/file/c8uh55l5nxnr245/Copy_Paste.xlsx/file



BlouBul :cool:
 

time*treat

Member
There are some extra tabs added as testing/learning space.
These can be removed.


https://www.mediafire.com/file/2fz20wb3zpasd89/Copy_Paste.xls/file
 

time*treat

Member
time*treat

Thank you, but how must I use the copy_function.......

BlouBul :cool:
the Call__Line__Adder sub shows how to call the function.

All you would change is the six numbers behind FCopy__Lines__Add__Spaces in the Call__Line__Adder sub.
Also FCopy__Lines__Add__Spaces can be called from any other code in the workbook.

In other words, unless you're changing the name of the workbook or names of the input /output sheets, you never alter the Copy__Function/FCopy__Lines__Add__Spaces macro itself.

FCopy__Lines__Add__Spaces 1,33,1,2,1,1
becomes
FCopy__Lines__Add__Spaces 1,33,1,6,1,4
for example.

Also any of the numbers can be replaced with a variable and the function can also be called in a loop.





 

Sidebar

Top