I have a workbook Group profits.2012. this workbook contains a large number of range names. I would like a macro to export/copy these range names into a new workbook Group profitts.2013
Your assistance in this regard is most appreciated
I have a workbook Group profits.2012. this workbook contains a large number of range names. I would like a macro to export/copy these range names into a new workbook Group profitts.2013
Your assistance in this regard is most appreciated
No error handling done.... so if the name already exists in the destination workbook, will throw an error.Code:Sub NameMover() Dim nm As Name For Each nm In Workbooks("NameOfTheBookWhereNamedRangesAreToBeMovedFrom").Names Workbooks("NameOfTheBookWhereNamedRangesAreToBeMovedTo").Names.Add nm.Name, nm.RefersTo, nm.Visible Next nm End Sub
A dream is not something you see when you are asleep, but something you strive for when you are awake.
It's usually a bad idea to say that something can't be done.
The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve
Join us at Facebook
Thanks for the help, much appreciated
Hi Excel Fox
You kindly assisted me by setting up code a while back to copy range names from onme workbook to another. It would be appreciated if you could amend your code to copy only those range names starting with HC for eg HC_Advertising , HC_PROV_BD etc
Regards
Howard
I have also posted on Hi Excel Fox
You kindly assisted me by setting up code a while back to copy range names from onme workbook to another. It would be appreciated if you could amend your code to copy only those range names starting with HC for eg HC_Advertising , HC_PROV_BD etc
Regards
Howard
I have also posted on the following site http://www.mrexcel.com/forum/excel-q...nge-names.html
Last edited by Howardc; 07-02-2013 at 11:20 AM.
Code:Sub NameMover() Dim nm As Name For Each nm In Workbooks("NameOfTheBookWhereNamedRangesAreToBeMovedFrom").Names If Ucase(LEFT(nm.Name,2)) = "HC" Then Workbooks("NameOfTheBookWhereNamedRangesAreToBeMovedTo").Names.Add nm.Name, nm.RefersTo, nm.Visible End If Next nm End Sub
A dream is not something you see when you are asleep, but something you strive for when you are awake.
It's usually a bad idea to say that something can't be done.
The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve
Join us at Facebook
Bookmarks