+ Reply to Thread
Results 1 to 2 of 2

stepping through a non-contiguous named range

  1. #1
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    328

    stepping through a non-contiguous named range

    I have a named range "images" that consists of B13:H13,B20:H20...B**:H**.
    If I check Range("images").address vba returns the correct non-contiguous range as above.
    I am trying to step through this range with a for i loop.
    If I check Range("images")(8) the address comes back as B14 not B20.

    Any ideas what is wrong and how to fix this?

    Correct addresses but not usable as must be part of an existing integer loop
    Please Login or Register  to view this content.
    Fills in the gaps in the range
    Please Login or Register  to view this content.
    Pretty sure this has solved it. Thanks Mark L for the range.areas.cells over range.cells suggestion. If anyone has a better solution feel free to comment.
    Please Login or Register  to view this content.
    Last edited by Leon V (AW); 07-22-2019 at 10:41 AM.
    Sub Reputation()
    Dim Problem as Variant
    Dim Reputation as Integer
    For Each Problem in Forum.Threads
        If Problem.Title = "*[Solved]*" and Solver.Name = "Leon V (AW)" Then Reputation = Reputation + 1
    Next Problem
    End Sub

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    A direction : work with the Areas of the Range (to see in VBA inner help or in any Microsoft website, whatever) …

+ 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. non-contiguous named range - how to use in formulas, or how to convert to contiguous list
    By david killoran in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-23-2019, 03:33 AM
  2. Named range for non-contiguous ranges
    By vikas.trades25 in forum Excel General
    Replies: 3
    Last Post: 05-08-2019, 12:15 AM
  3. copy one row of named range spanning non contiguous columns
    By Lucas12345678920 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2013, 09:59 PM
  4. VBA - Input Value If Column Number Equals "x" within Non-Contiguous Named Range
    By greenexcel12345 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2011, 02:23 PM
  5. Pivot table based on named (non-contiguous) range
    By kuraitori in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 12:29 PM
  6. Vlookup on Non Contiguous Named Range
    By sflemings in forum Excel General
    Replies: 6
    Last Post: 01-20-2010, 06:58 AM

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