LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Losing Named Range Definitions

I'm trying to copy the contents of a named range on one worksheet over
to another named range on another worksheet, using Paste Special macro
code. However, when I execute the macro, it seems to lose the
definition of the target named range.

1. I defined the source named range "RisksTable" as $AI$31:$AR$36 on
one worksheet, called "6-Blocker", using the spreadsheet menu
functions.
2. I defined the target named range "RisksTableTarget as $A$33:$J38 on
another worksheet, called "Project Risks", also using the spreadsheet
menu functions.
3. My code looks like this:

Sheets("6-Blocker").Select
Range("RisksTable").Select
Selection.Copy
Sheets("Project Risks").Select
Range("RisksTableTarget").Select

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

4. When I execute the code, it fails with run-time error 1004, "Method
'Range' of object_Global failure". I went back to the range
definitions and found that while RisksTable was intact, the range
RisksTableTarget has been re-defined somehow as 'Project Risks'!REF#.

5. If instead of referencing the named range, "RisksTableTarget", I
use a cell range, i.e., $A$33:$J$38, the code runs fine. But I need to
reference the named range, because the user will be making changes to
named range definitions only, and not have to diddle around with the
code.

Can somebody help with this problem?

Thanks in advance.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Losing a named range bluegrassstateworker Excel Discussion (Misc queries) 3 August 28th 07 07:20 PM
Exporting range definitions from one workbook to another indiana1138 Excel Programming 2 March 20th 07 05:46 PM
Sustaining Range Definitions in a Function hoftenkrabb Excel Discussion (Misc queries) 1 November 28th 06 03:54 AM
How can I change range name definitions as the No. of rows change. [email protected] Excel Programming 1 June 20th 06 03:40 AM
Trouble with 2 range definitions ... Celt[_39_] Excel Programming 7 April 5th 06 04:45 PM


All times are GMT +1. The time now is 05:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"