Copy/Paste Macro

eddiet

New Member
Joined
Jun 3, 2008
Messages
18
Alright so I continue on my little project and I need some additional help. I've asked a lot from the community, so I feel that I should reward the person that helps me figure this out.

I have this table of information that I'm trying to export to another tab that has this standard template that I need the respective information from each row of the table to fill this template.

What I want to do is create a macro when run will copy the data from the table to this standard template (think of it as the letter merge you can do with Word/Excel, but all within Excel now). Heres the first part of the code that I used to ask how many templates that I need to make.

x = InputBox("How many copies of TOE do you need??")
For numtimes = 1 To x
'Loop by using x as the index number to make x number copies.
ActiveWorkbook.Sheets("Blank").Copy _
After:=ActiveWorkbook.Sheets("Blank")

Heres a copy of the table that I have

untitled.JPG

As you can see the information that I need to take are not in one straight row to make things super easy (they are marked in "X"), but they repeat every 4 rows.

So I think I have a bit of a start of the code that I need to add to the original macro so that it imports the data from this table to the standard template but could use some help because I know its not 100% correct because when i try to run it, it doesn't work. I think my largest issue will be how I select the sheets to paste this information.

Dim x As Integer
x = InputBox("How many copies of TOE do you need??")
For numtimes = 1 To x
'Loop by using x as the index number to make x number copies.
ActiveWorkbook.Sheets("Blank").Copy _
After:=ActiveWorkbook.Sheets("Blank")
Sheets("APG").Select
Range("B", "(7+4*X)").Select
Selection.Copy
Sheets("Blank", "(1+X)").Select
Range("B", "(7+4*X)").Select
ActiveSheet.Paste
Next

the 4 is used because its every 4th row.

Thank you in advance for helping a newbie
 
Last edited:

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Watch MrExcel Video

Forum statistics

Threads
1,123,492
Messages
5,601,994
Members
414,490
Latest member
Rip181

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top