?
Solved

Copying Defined Names in Excel

Posted on 2013-11-17
9
Medium Priority
?
3,189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 6

Assisted Solution

by:Michael
Michael earned 600 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 23

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
LVL 23

Assisted Solution

by:Ejgil Hedegaard
Ejgil Hedegaard earned 600 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 800 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

764 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