Is there a way to copy named ranges to another workbook?

Burrgogi

Active Member
Joined
Nov 3, 2005
Messages
340
Office Version
  1. 2010
Platform
  1. Windows
I have 2 workbooks that are similar to each other. Each workbook contains several worksheets.

Workbook #1:
sheet 1
sheet 2
sheet 3
sheet 4
etc.

Workbook #2:
sheet 1
sheet 2
sheet 3
sheet 4

There are named ranges all over the workbook in various locations. The only one that I care about is sheet 4. I want to copy all the named ranges into Workbook #1 'sheet 4' over to Workbook #2 'sheet 4'

I know I can just as easily use the copy worksheet feature in Excel but that poses a separate problem for me. I have hyperlinks in 'sheet 1' pointing to these named ranges and when I copied 'sheet 4' from one workbook to another, I found that it really messes up the hyperlinks.

I've googled for an answer but I'm not getting anything useful.
 
Is that a space you've got between the closing parenthesis and the double quotation mark in your version of the code? If it is - there's your problem, the code is looking for a sheet name with a space at the end of its name.

No, there are no other characters or spaces after the closing parenthesis.
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
No, there are no other characters or spaces after the closing parenthesis.
Then the only way I can help you any further is if I get to see your actual file - shared via Dropbox, Google Drive or something similar.
 
Upvote 0
Just confirming that you're putting the code in the workbook that contains the source data, and that in that workbook the "sheet4" is named exactly as you have in the code?
 
Upvote 0
Just confirming that you're putting the code in the workbook that contains the source data, and that in that workbook the "sheet4" is named exactly as you have in the code?

No, I had saved your macro in my PERSONAL.XLSX file.

I really don't want to spend any more time on this. It was purely for my own amusement and nothing more.

Thanks for the help.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,537
Members
449,088
Latest member
RandomExceller01

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