RE: Tranferring names defined in one excel workbook to another workboo

From: JLatham <JLatham_at_discussions.microsoft.com>
Date: Fri, 30 Jun 2006 21:34:02 -0700


Both workbooks need to have same sheet names in order for this to work without error when you try to reference the named ranges in the second workbook. Put this code in the workbook with the names already defined. Open up the second workbook and then run the macro:

Sub CopyNamedNamedRanges()
Dim AnyName As Object     

For Each AnyName In ThisWorkbook.Names
  Workbooks("Book2.xls").Names.Add AnyName.Name, AnyName.RefersTo, True Next

End Sub

Change "Book2.xls" to the name of the workbook you need to move the named ranges into.

"Dinesh" wrote:

> I defined some names using name manager in One Excel workbook . i want to
> transfer all the namespaces into another workbook.
> How can i do that ?
Received on Fri Jun 30 2006 - 21:34:02 PDT

Click to report inappropriate content