Solved

Copying Defined Names in Excel

Posted on 2013-11-17
9
1,182 Views
Last Modified: 2013-11-19
EE Pros,

I have a large number of "Range Names" that I'm trying to copy from one Worksheet to another.  There doesn't seem to be an easy way to do this; forcing me to redo each of the Range names.  Is there a way to copy a number of Range names at one time from one Workbook to another.

Thank you in advance.

B.
0
Comment
Question by:Bright01
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 6

Assisted Solution

by:Michael
Michael earned 150 total points
ID: 39654515
Hi B.

you can try this solution. Be sure to have both workbooks open, have the source workbook active and change the name of your destination workbook in the macro accordingly:

 Sub Copy_All_Defined_Names()
   ' Loop through all of the defined names in the active workbook.
     For Each x In ActiveWorkbook.Names
      ' Add each defined name from the active workbook to the target workbook ("Book2.xls").
      ' "x.value" refers to the cell references the defined name points to.
      Workbooks("Book2.xls").Names.Add Name:=x.Name, _
         RefersTo:=x.Value
   Next x
End Sub

Open in new window

Be sure to test this code first on a copy of your workbooks.

Joop
0
 
LVL 21

Expert Comment

by:Ejgil Hedegaard
ID: 39654781
If you copy the sheet to the other workbook, all names with reference to that sheet, will also be copied to the new workbook, and have the same sheet references.
0
 

Author Comment

by:Bright01
ID: 39654865
Is there any way to copy (besides one at a time) without using a Macro?  And if I do use the Macro, do I put it in a Module in the target WB or the specific target WS?

Thank you,

B.
0
 
LVL 6

Expert Comment

by:Michael
ID: 39654910
You can try hgholt's suggestion for a non-macro solution.

If you use the macro, place it in either workbook in a module. As long as you have the source workbook active when you execute it.

Joop
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 21

Assisted Solution

by:Ejgil Hedegaard
Ejgil Hedegaard earned 150 total points
ID: 39654994
You can copy all sheets in one process.
Activate the first sheet.
To group a series of sheets hold down the Shift key and point at the last sheet tab.
To group non contiguous sheet, hold down the Ctrl key and point at the sheet tabs one at a time.
Then right-click at one of the activated tabs and copy the sheets.
To deactivate the sheet group activate a  sheet not in the group.
0
 

Author Comment

by:Bright01
ID: 39655198
Hgholt,

Just to be clear, I'm trying to copy "names" (Formulas; Range Names) over.  I understand that if I copy a sheet or multiple sheets the range names come over, but if I'm simply coming Range Names in the  Name Manager, I can not seem to copy multiple names at one time.  That means if I don't copy the sheets but want to copy the Names, I have to recreate the Names one at a time.  That's what I'm trying to see if there is a way to simply copy and paste or drop and drag.  

Does your approach by coping over the sheets and then not activating them.....will that work?

B.
0
 
LVL 4

Accepted Solution

by:
yuppydu earned 200 total points
ID: 39656178
There is a very useful add-in developed by Rob Bovey which adds a set of utility in the excel ribbon. One of them lets you export all range names in a separate sheet. From there you can easily recreate all range names in a new workbook.
The link to get the add-in for free: www.appspro.com/Utilities/ExcelUtilities.htm
0
 

Author Closing Comment

by:Bright01
ID: 39659258
Thanks guys; I can use all of these methods but I really like the utility!

All the best,

B.
0
 
LVL 4

Expert Comment

by:yuppydu
ID: 39659387
Well thanks Rob!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now