Macro to Determine Length from Middle of Column

1. Macro to Determine Length from Middle of Column

I currently have a post that has been unanswered, so in trying to work it out myself I have a more specific question.
In the middle of my spreadsheet are two columns of data I'm working with, that will eventually be involved in an if statement.

I need a macro to count the cells filled in Column G for example versus Column H, except it won't be from G1 or H1.
It'll always be the same starting point, so let's say G20 and H20.
So the macro should somehow select that cell then count how long that range is and be able to dimension it.

Then my if statement could say if rangeG > rangeH then ect.

So basically I need a code to dimension a range by counting it, but to be able to start from the middle of the range.
This is what I currently have that won't work for any starting point except G1:

2. Re: Macro to Determine Length from Middle of Column

Hi,

Can't you just use

=COUNTA(G20:G100)

3. Re: Macro to Determine Length from Middle of Column

The length of the range will be changing. So I need the macro to determine the length having only been given the starting cell.

4. Re: Macro to Determine Length from Middle of Column

Would it be possible to divide rangeG in half and then apply that to a new starting range as opposed to G1? I'm not on acomputer with excel at the moment or I would try it out.

5. Re: Macro to Determine Length from Middle of Column

I'm not sure. Another idea I had was to count the entire column G, then subtract the known starting range of G1:G20.
But I don't know if it's possible to have a range dimensioned like that??

There are currently 1 users browsing this thread. (0 members and 1 guests)

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