Results 1 to 4 of 4

Working named ranges in multiple sheets from vba

Threaded View

  1. #1
    Registered User
    Join Date
    03-27-2006
    Posts
    70

    Working named ranges in multiple sheets from vba

    In the following:
    Set I_Pts_2_Range = Range(Range("I_WP_2b").Offset(1, -1).Address & ":" & Range("I_WP_2e").Offset(-1, -1).Address)
    
    'Inventory Assessment page ranges
    Set IA_MC1_r = Range(Range("IA_MC1_b").Offset(1, -1).Address & ":" & Range("IA_MC1_e").Offset(-1, -1).Address)
    Both I_Pts_2_Range and IA_MC1_r are defined as ranges
    Dim IA_MC1_r  as range, dim IA_MC1_r  as range
    The sub they are in is initiated while on the sheet that has the ranges' addresses that follow in the first line. All the ranges and addresses that follow in the second line are on another sheet ("MC Inventory Assessment"). Each of the named ranges on the right side of the assignment are single cells.

    The first line of code runs fine, doing what it is supposed to do, but the second line blows up in an "application-defined or object-defined error". I don't get it, for I thought that the names were supposed to be work-book wide in scope. If one implementation doesn't work, then why not the other?

    Can anyone tell me what I am doing wrong and how to make it work?
    Last edited by brucemc; 08-20-2007 at 03:18 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1