Solved

Copying Defined Names in Excel

Posted on 2013-11-17
9
2,184 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 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 22

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 22

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
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…

733 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