+ Reply to Thread
Results 1 to 2 of 2

Code to refer to Dynamic Range

  1. #1
    Registered User
    Join Date
    02-21-2014
    Location
    Connecticut, U.S.A.
    MS-Off Ver
    Excel 2010
    Posts
    52

    Code to refer to Dynamic Range

    hey guys - I put together a quick set of code to search for a selected value and return a sumif value for the selected value. Instead of referring to the range explicitly, I'd like to refer to a named range that I created.

    Here is the code:

    Please Login or Register  to view this content.

    In place of range("M2:M766"), I'd like to refer to a named range I created called Check_nbr1 and for range("O2:O766"), I'd like to refer to a named range called Paid_Amt. I tried to do that in the code but it errored: Run-time error 1004': Method 'Range' of object '_Global' failed. I'm guess it can't be done this way?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Code to refer to Dynamic Range

    Hello philozelda,

    Did you try this?
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. [SOLVED] Need help with Dynamic Range in my code.
    By moonsaga in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2014, 01:08 PM
  2. [SOLVED] Cannot refer to a dynamic range in a closed workbook
    By BNCOXUK in forum Excel General
    Replies: 7
    Last Post: 01-07-2014, 09:56 AM
  3. Problem changing R1C1 code to refer to specific, asbolute range
    By MichaelMcF in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2011, 01:13 PM
  4. How to refer code to specific range in worksheet
    By gulaina in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2010, 04:16 AM
  5. refer to dynamic range in closed workbook with ADO
    By MattShoreson in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-13-2005, 06:26 AM

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