I am having problems coping macro from one workbook to use in another workbook

Corried

Board Regular
Joined
Dec 19, 2019
Messages
217
Office Version
  1. 2019
Platform
  1. Windows
  2. Web
Hello Excel World

Thanks in advance for your support.

Before I explain my problem. It may make sense to show how the macro is working on the current workbook for my coping. Once this is done. If you are comfortable, the files would have to download to know if it could be done.

I have two workbooks that work together:

# 1 Unemployment rate and
# 2 GDP_Annual_Growth_Rate_%

Now. Macros are created in the Unemployment_Rate workbook for the following:

# 1 To copy data that has the same worksheet name from the GDP_Annual_Growth_Rate_% workbook and paste it into column "f" of the Unemployment_Rate workbook. Please see the picture below.

at
Next. The macro is also created for a comparison charts. Compare the Unemployment_Rate workbook with the GDP_Annual_Growth_Rate_% workbook in the chart. The data is in columns "B", "E" and "F".

bvs
Next. On column "K". We have the header on cell "K1": Number of years in the X axis.

And on "k2" is a fixed number "10" which represents 10 years of graph data in the future.

And on "K3" there is a patch number "-10" which represents 10 years of graphics data in the past.

d
Next. the left and right arrows are used to go back to the past or forward to the future years "10" and "-10"

e
Here are the two workbooks that work together:

#1 Unemployment rate : Unemployment_Rate.xlsm
#2 GDP_Annual_Growth_Rate_%: GDP_Annual_Growth_Rate_% (1).xlsm

My problem is: how can I copy macro from Unemployment_Rate workbook, adjust the macro and paste it into another workbook (PMI workbook), that also works with GDP_Annual_Growth_Rate_% workbook.

Here are the new and partially completed workbook:

#1 PMI: PMI.xlsm

Can someone help me and explain my errors on how I am not getting it done the right way? I really appreciate the support.

Thank you in advance

Cheers
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Before I try to help, if this is a manual copy and change of file names (which it sounds like you are asking), Then I can definitely help, if you are looking for a macro to copy a macro and alter it, then I have no clue where to start.
 
Upvote 0
Before I try to help, if this is a manual copy and change of file names (which it sounds like you are asking), Then I can definitely help, if you are looking for a macro to copy a macro and alter it, then I have no clue where to start.

Thanks dnorm, for reaching out to me. I really appreciate it.

The problem. It is not a manual copy or of changing the file name. The file is similar but not the same.

Example:
Unemployment rate workbook have 181 worksheet and
GDP_Annual_Growth_Rate_% worksheet have 185 worksheets.

Both workbooks have the same worksheets names, but different data. A macro was created to link both workbooks and link the same worksheet names to create a comparison chart for each worksheet.

This two workbooks works together.

The question is, how can I make PMI workbook work together with GDP_Annual_Growth_Rate_% workbook, using or coping macro from Unemployment rate workbook.

Example:

PMI workbook have 51 worksheets.
GDP_Annual_Growth_Rate_% worksheet have 185 worksheets.

Both workbooks have the same worksheets names, but different data. A macro was created to link both workbooks and link the same worksheet names to create a comparison chart for each worksheet.

This two workbooks works together.

I just want to use the macro from Unemployment rate workbook to work with PMI workbook.

Hop I answer your question. I am not sure if you can help me...

Thanks in advance
 
Upvote 0
Sorry, I have struggled to get this to function as you wanted. I have not given up though and if I do succeed then I will post up what I did.
 
Upvote 0
Thank you dnorm. I found the answer. I have searched different forum and I have found no answer. I paid for the services. It took me a long time. Only got the answer 3 days ago.

Thanks again for your support. My need it again in the future...
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

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