Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy worksheets between workbooks - including named ranges
Hi,
I'm working on a workbook which makes extensive use of named ranges (which is good). However, depending on what a user selects, one of the worksheets may need to be replaced with another (the user can select whether to run a "full" or "mini" run of the model, if a mini is run then one sheet needs to be replaced). Because the rest of the sheets in the workbook reply on named ranges in the "full" sheet, when it is replaced with the "mini", I need the same named ranges to be there. I am trying to replace the sheet as follows: Set sourceworkbk = Workbooks("Valuation_mini.xls") Set destworkbk = Workbooks("Valuation_full.xls") ' copy the worksheet over sourceworkbk.Worksheets("mini calculation").Copy after:=destworkbk.Worksheets(destworkbk.Worksheets .count) this copies the worksheet into the workbook fine, but does not appear to bring the named ranges with it. I.e. named ranges defined in Valuation_mini.xls are not available once the sheet is copied into Valuation_full.xls. Is there any way to force it to bring named ranges with it? Thanks in advance, Chris |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy worksheets between workbooks - including named ranges
Isn't that its default behaviour?
-- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "christian_spaceman" wrote in message ... Hi, I'm working on a workbook which makes extensive use of named ranges (which is good). However, depending on what a user selects, one of the worksheets may need to be replaced with another (the user can select whether to run a "full" or "mini" run of the model, if a mini is run then one sheet needs to be replaced). Because the rest of the sheets in the workbook reply on named ranges in the "full" sheet, when it is replaced with the "mini", I need the same named ranges to be there. I am trying to replace the sheet as follows: Set sourceworkbk = Workbooks("Valuation_mini.xls") Set destworkbk = Workbooks("Valuation_full.xls") ' copy the worksheet over sourceworkbk.Worksheets("mini calculation").Copy after:=destworkbk.Worksheets(destworkbk.Worksheets .count) this copies the worksheet into the workbook fine, but does not appear to bring the named ranges with it. I.e. named ranges defined in Valuation_mini.xls are not available once the sheet is copied into Valuation_full.xls. Is there any way to force it to bring named ranges with it? Thanks in advance, Chris |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
copy worksheets between workbooks - including named ranges
It doesn't appear to be. A named range available in the sheet before
the copy isn't in the destination book after the copy. On Dec 20, 12:55 pm, "Bob Phillips" wrote: Isn't that its default behaviour? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "christian_spaceman" wrote in message ... Hi, I'm working on a workbook which makes extensive use of named ranges (which is good). However, depending on what a user selects, one of the worksheets may need to be replaced with another (the user can select whether to run a "full" or "mini" run of the model, if a mini is run then one sheet needs to be replaced). Because the rest of the sheets in the workbook reply on named ranges in the "full" sheet, when it is replaced with the "mini", I need the same named ranges to be there. I am trying to replace the sheet as follows: Set sourceworkbk = Workbooks("Valuation_mini.xls") Set destworkbk = Workbooks("Valuation_full.xls") ' copy the worksheet over sourceworkbk.Worksheets("mini calculation").Copy after:=destworkbk.Worksheets(destworkbk.Worksheets .count) this copies the worksheet into the workbook fine, but does not appear to bring the named ranges with it. I.e. named ranges defined in Valuation_mini.xls are not available once the sheet is copied into Valuation_full.xls. Is there any way to force it to bring named ranges with it? Thanks in advance, Chris- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Stop named ranges from copying into other workbooks | Excel Worksheet Functions | |||
How do I copy a group of worksheets with named ranges in Excel 200 | Excel Worksheet Functions | |||
Named ranges which seem to reference old workbooks/worksheets | Excel Discussion (Misc queries) | |||
Copy data in named ranges to a newer version of the same template to identical ranges | Excel Programming | |||
Named Ranges - Slow Workbooks! | Excel Programming |