Im learning a little VBA, but I'm stuck with a range issue.
Im starting with columns A,B,C
and i want to achieve D
So my range is effectively in column A (each name change represents a new 'range' - and they are in alphabetical order down the page)
I'm currently using an 'average if' helper column in macros to help me with this, but the problem is i have big files (over 150,000 rows), and 'average if' takes a very long time (I do many of these during a macro)
within my code, im trying to use variations of 'dim' but I'm not getting anywhere.
Is there something i use with 'dim' to select column A, and use each name (each range begins with a name change moving down the column) as individual ranges, so that when i apply a function or sum in column D, and run it down the page in my macro, i can get the result as per the table below? then i can add this code ( i need this for many things, on different sheets and different workbooks, and if the range column "A" changes, i can change that reference in the code to suit the file )
I would like to use it with the various functions i use now ('if' 'and' 'or' etc) and I"m looking for something flexible that excludes specific object references to worksheet/column names etc.
Is something possible with this, or am i stuck with my slow average-if helper columns?
<tbody>
</tbody>
Im starting with columns A,B,C
and i want to achieve D
So my range is effectively in column A (each name change represents a new 'range' - and they are in alphabetical order down the page)
I'm currently using an 'average if' helper column in macros to help me with this, but the problem is i have big files (over 150,000 rows), and 'average if' takes a very long time (I do many of these during a macro)
within my code, im trying to use variations of 'dim' but I'm not getting anywhere.
Is there something i use with 'dim' to select column A, and use each name (each range begins with a name change moving down the column) as individual ranges, so that when i apply a function or sum in column D, and run it down the page in my macro, i can get the result as per the table below? then i can add this code ( i need this for many things, on different sheets and different workbooks, and if the range column "A" changes, i can change that reference in the code to suit the file )
I would like to use it with the various functions i use now ('if' 'and' 'or' etc) and I"m looking for something flexible that excludes specific object references to worksheet/column names etc.
Is something possible with this, or am i stuck with my slow average-if helper columns?
A NAME | B High | C Low | D high minus low |
barry1000 | 6 | ||
barry1000 | 15 | 6 | |
barry1000 | 9 | 6 | |
barry2000 | 4 | 4 | |
barry2000 | 8 | 4 | |
barry3000 | 6 | ||
barry3000 | 12 | 6 | |
barry3000 | 6 | ||
barry3000 | 6 | ||
barry3000 | 6 | 6 | |
barry4000 | 26 | 17 | |
barry4000 | 9 | 17 |
<tbody>
</tbody>