+ Reply to Thread
Results 1 to 6 of 6

How to define, refer to and reference ranges on inactive sheets

  1. #1
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    How to define, refer to and reference ranges on inactive sheets

    Hi all,

    I keep getting RunTime Error 1004: Method 'Range' class of object '_Worksheet' failed with the following code.

    In the past I've used dynamic named ranges with the built in OFFSET function and Name Manager to reference ranges on inactive sheets. I'm trying to get away from that. I understand that the .Range property normally defaults to the Active sheet as it's object without an object qualifier. What I don't understand is how my code below does not provide that. Each Worksheet object is declared and defined. Can anyone point out why this is not working or provide guidance on another method.

    The code is simply intended to populate various combo boxes of a user-form from worksheet ranges.

    Please Login or Register  to view this content.
    Thanks.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to define, refer to and reference ranges on inactive sheets

    In this and other statements like it,

    Please Login or Register  to view this content.
    ... Cells, unqualified, refers to the active worksheet.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to define, refer to and reference ranges on inactive sheets

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Re: How to define, refer to and reference ranges on inactive sheets

    Thanks. That solved it.

    So the "With" statement applies the wsLists qualifier to any argument that needs it? Is that correct?

    The expanded Code would be something like:

    Please Login or Register  to view this content.
    For example?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to define, refer to and reference ranges on inactive sheets

    Did you look at post #3?

  6. #6
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Re: How to define, refer to and reference ranges on inactive sheets

    Yep, just making sure I understand what the code is doing.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel VBA working with inactive Sheets
    By lmaso382 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-11-2014, 05:02 PM
  2. Change formatting of cells on inactive worksheet using cell reference
    By wedwo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2014, 04:46 AM
  3. Replies: 1
    Last Post: 05-22-2013, 01:49 AM
  4. [SOLVED] Use Cell Reference to Define Sum Ranges Across Different Sheets
    By jwhite0720 in forum Excel General
    Replies: 2
    Last Post: 06-29-2012, 11:34 AM
  5. How to refer "user's define reference" in a macro?
    By dusit_t in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2012, 02:18 PM
  6. Addressing cells on inactive sheets
    By John Duffus in forum Excel General
    Replies: 4
    Last Post: 10-22-2005, 02:05 PM
  7. How To Reference Range Inactive Workbook
    By jazzjava in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-09-2005, 08:19 PM

Tags for this Thread

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