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

Corried

Board Regular
Joined
Dec 19, 2019
Messages
159
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".

b vs
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
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

dnorm

Board Regular
Joined
Dec 28, 2017
Messages
87
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.
 

Corried

Board Regular
Joined
Dec 19, 2019
Messages
159
Office Version
  1. 2019
Platform
  1. Windows
  2. Web
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
 

dnorm

Board Regular
Joined
Dec 28, 2017
Messages
87
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.
 

Corried

Board Regular
Joined
Dec 19, 2019
Messages
159
Office Version
  1. 2019
Platform
  1. Windows
  2. Web
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...
 

Watch MrExcel Video

Forum statistics

Threads
1,113,744
Messages
5,543,955
Members
410,586
Latest member
acadavid86
Top