mike637
asked on
Excel VBA copy all named ranges to workbook
Hello Experts,
I need to copy one workbook to another. They are set up identically, however on one specific sheet, I need to copy the data in the named ranges to the identical named ranges in the 2nd workbook sheet. (I have other data on the sheet - but do not want to copy that).
Is this possible?
Both sheets named "STAGING AREA" or Sheet12.
There are 35 identically named ranges in each sheet.
wb1 and wb2 have been declared.
Any assistance would be appreciated.
Thank you,
Michael
I need to copy one workbook to another. They are set up identically, however on one specific sheet, I need to copy the data in the named ranges to the identical named ranges in the 2nd workbook sheet. (I have other data on the sheet - but do not want to copy that).
Is this possible?
Both sheets named "STAGING AREA" or Sheet12.
There are 35 identically named ranges in each sheet.
wb1 and wb2 have been declared.
Any assistance would be appreciated.
Thank you,
Michael
ASKER
I am sorry Brian, I guess I was off on how I worded by request,
I have 35 named ranges on wb1.sheet12 and I want to copy those to wb2.sheet12.
How can I have it find all named.ranges and copy those from wb1 to wb2 without having to list out each named range to copy.
Could it not be something like
For each named.range in sheet12
something something
or loop through the sheet and find each named range and copy it to wb2?
Michael
I have 35 named ranges on wb1.sheet12 and I want to copy those to wb2.sheet12.
How can I have it find all named.ranges and copy those from wb1 to wb2 without having to list out each named range to copy.
Could it not be something like
For each named.range in sheet12
something something
or loop through the sheet and find each named range and copy it to wb2?
Michael
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks once again Brian!
I really appreciate you.
Michael
I really appreciate you.
Michael
Glad to help, Michael!
If I've understood you correctly, this is straightforward. I've included two files each with a name "Fred". the macro in One.xlsm copies its Fred to Two.xlsm. The line of code is...
wbk1 .Sheets("Sheet1").[Fred].C
Regards,
Brian.One.xlsmTwo.xlsx