VBA: Copy and pasting severall sets of equally spaced data from one workbook to another

taylorjfab

New Member
Joined
May 1, 2013
Messages
1
Hi Guys,

I am currently trying to write a macro to cop and paste severall sets of data from one workbook to another. There are two parts to my problem:
1) The workbook name will be pasted into a cell which the macro will refference (the refference workbook will already be open so we do not need to include this command)

Is there a way to link a macro to a cell where name is typed in?

2) when copy and pasting the data I am looking for a quick bit of code; i.e. there are 20 different scenarios will varying inputs which need to be copied across (values only - so paste special function) to said active workbook at same cell positsions when macro is run

e.g. The cells in scenario 1 that need to be copied across are: D189:D191, G190:H191, M187, D194:D213, D215, H194:H213

The The cells in scenario 2 that need to be copied across are: D220:D222, G221:H222, M218, D225:D244, D246, H225:H244

etc.....

for each scenario the cell difference is +31, up to 20 scenarios

Does anyone have an equation that can be used to automate this without recording a long and slow macro

Many Thanks,
Jonny
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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
Back
Top