+ Reply to Thread
Results 1 to 2 of 2

Stepped loop through splintered range of cells

  1. #1
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Stepped loop through splintered range of cells

    Well, if that title isn't clear, then I don't know what could be! ;-)

    To be honest, apologies for that title - I am trying to do something and I am not sure how.

    I get a range of cell addresses from a filtered list, where I only grab the blank cells, like below:

    Please Login or Register  to view this content.
    This returns: $AR$3,$AR$10:$AR$11,$AR$23:$AR$33,$AR$35:$AR$49,$AR$84,$AR$89:$AR$91,$AR$93,$AR$100:$AR$103,$AR$195,$AR$214,$AR$226,$AR$244,$AR$248,$AR$272,$AR$286,$AR$303,$AR$330,$AR$334:$AR$559

    If I say the below, it returns 273 - the actual number of blank cells.
    Please Login or Register  to view this content.
    but saying 'rng(4).address' doesn't give me the address of the 4th blank cell, but just gives me $AR$6, which is not actually in the range. And saying 'rng(600).Address' just gives me $AR$602... you get the idea, but that's not correct.


    What I am trying to do is:
    Please Login or Register  to view this content.
    Is there a way to do a loop like the above on a jagged range like in the example?
    Thanks!

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Stepped loop through splintered range of cells

    You can set the range to an array first, then you can do the rest of your mentioned operations based on this array :

    Please Login or Register  to view this content.
    Attached Files Attached Files
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

+ 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. Find two strings in a range select cells in between and loop through range
    By maxwell13 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-27-2018, 04:04 AM
  2. [SOLVED] Loop through a range of cells and automatically add a blank row between groups of cells
    By bryfi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-09-2017, 03:41 PM
  3. [SOLVED] do while loop for range of cells
    By MeerskiD in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2013, 03:24 AM
  4. How to vary a range of cells within a FOR loop
    By reezyf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2013, 09:56 PM
  5. Replies: 1
    Last Post: 01-23-2013, 03:00 PM
  6. How do I sort a range of cells and then loop through the sorted cells
    By mcelvain in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2008, 09:48 AM
  7. Replies: 5
    Last Post: 04-03-2005, 05:06 PM

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