+ Reply to Thread
Results 1 to 4 of 4

Find Range Function

  1. #1
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Find Range Function

    I have used this so much I cannot do without it - it is a quick method to find all the ranges within a range than containing a value. The function is
    Please Login or Register  to view this content.
    This can be called with
    Please Login or Register  to view this content.
    Then simple matter of iterating through myRange to get all the ranges with the value. Could not live without this great function. Very robust.
    Last edited by smuzoen; 07-05-2012 at 08:45 PM. Reason: Amended code - correct error
    Hope this helps.
    Anthony
    Pack my box with five dozen liquor jugs
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?

  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: Find Range Function

    You can assign default values to the arguments in the signature:

    Please Login or Register  to view this content.
    In addition, and notwithstanding that it appears as an example in Help, this line makes no sense:

    Please Login or Register  to view this content.
    In the code here, c cannot be Nothing (that's already been tested), and if it were, c.Address would generate a runtime error.
    Last edited by shg; 07-05-2012 at 11:56 AM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Find Range Function

    I've been using a similar loop but didn't know about the UNION trick...that kicks a$$
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  4. #4
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Find Range Function

    @shg you are dead right - my bad - it should be
    Please Login or Register  to view this content.

+ Reply to Thread

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