I am trying to count the number of rows between areas in a collection (not sure if considered to just be a selection or a collection)
The code selects only the visible cells in the range specified. Each block of contiguous cells then makes up 1 area in the collection of areas.
I want to find the number of rows between each of these areas. (I need it for some other code i'm running not relevant to this)
Is it possible to work with the areas in my collection outside of the For Each loop. Like reference the area index somehow IE: could I find the last row of area 1 and the first row of area 2 and then take the difference between the two to get my count of rows between the two areas or do i individually have to loop through each area
something like this
or is it possible to select the non visible cells in the range (like a non visible equivalent of the specialcells(xlcelltypevisible) command or some other method) and create a collection of areas made up of each block of non visible cells so I can then count the rows in each of those areas
something like this
The current method i am using is just running a loop that checks if each cell is hidden and if hidden increments the rowsbetween up to get the rows between areas. It works but i'm trying to avoid loops if possible and wanted to see if there was some cleaner method to do this.
Here is that code for reference or see the attached file (module 1):
Bookmarks