Excel for Mac 2011
Trying to follow the macro created in this post about copying named ranges:
http://excelribbon.tips.net/<wbr>T008811_Copying_Named_Ranges.<wbr>html
(Use a macro to copy a bunch of named ranges to a new workbook with the exact same data set, worksheet names.)
But in the line that should be
I did:
And it dies at that point.
I get "Run-time error '9': Subscript out of range"
And it shows the error by highlighting the line above.
I opened up terminal to verify my target is properly named and that it exists and did:
[my_userid-mbp:~] my_userid% ls /Users/my_userid/Downloads/<wbr>Olys%20SPC3%20with%<wbr>20Glak%20DRD.xlsm
/Users/my_userid/Downloads/<wbr>Oly%20SPC3%20with%<wbr>20Glak%20DRD.xlsm
The full macro is:
Any suggestions?
Trying to follow the macro created in this post about copying named ranges:
http://excelribbon.tips.net/<wbr>T008811_Copying_Named_Ranges.<wbr>html
(Use a macro to copy a bunch of named ranges to a new workbook with the exact same data set, worksheet names.)
But in the line that should be
Code:
Set Target = Workbooks("Book2.xlsx")
Code:
Set Target = Workbooks("/Users/my_userid/Downloads/Oly%20SPC3%<wbr>20with%20Glak%20DRD.xlsm")
And it dies at that point.
I get "Run-time error '9': Subscript out of range"
And it shows the error by highlighting the line above.
I opened up terminal to verify my target is properly named and that it exists and did:
[my_userid-mbp:~] my_userid% ls /Users/my_userid/Downloads/<wbr>Olys%20SPC3%20with%<wbr>20Glak%20DRD.xlsm
/Users/my_userid/Downloads/<wbr>Oly%20SPC3%20with%<wbr>20Glak%20DRD.xlsm
The full macro is:
Code:
Sub CopyNames()
Dim Source As Workbook
Dim Target As Workbook
Dim n As Name
Set Source = ActiveWorkbook
Set Target = Workbooks("[FONT=monospace]/Users/[FONT=monospace]my_userid[/FONT]/Downloads/<wbr>Oly%20SPC3%20with%<wbr>20Glak%20DRD.xlsm[/FONT]")
For Each n In Source.Names
Target.Names.Add Name:=n.Name, RefersTo:=n.Value
Next
End Sub
Any suggestions?