View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default How export all Names to another workbook?

Hi Maria,

Try:

Sub CopyNames()
Dim Nme As Name
Dim WB1 As Workbook
Dim WB2 As Workbook

Set WB1 = Workbooks("BookTWO") '<<====== CHANGE
Set WB2 = Workbooks("BookONE") '<<====== CHANGE

For Each Nme In WB1.Names
WB2.Names.Add Nme.Name, RefersTo:=Nme.RefersTo
Next

End Sub


---
Regards,
Norman



"Maria J-son" wrote in message
...
Hi brains,

I got a workbook with many named ranges & objects etc and I don't want to
hack them all into Define name - Refere to: window one by one. How can I
transfere them to another workbook? I guess there is some vba needed for
this...


/Regards