Howdy folks -
I'm trying to get the following excel array formula to work in VBA:
The problem is, the static references change from use to use. So, for example, while the above code would be fine for one sheet, it may be:
on another. This is all fine if I use regular MyRange.End(xlDown) stuff, but the documentation (and all my stinking error messages) tell me that I need to use R1C1 format to create an arrayformula via VBA. My question is: how can I generate a R1C1 reference via VBA?
Thanks!
I'm trying to get the following excel array formula to work in VBA:
Code:
=SUM(IF($P$2:$P$63=R2,1,0))/2
The problem is, the static references change from use to use. So, for example, while the above code would be fine for one sheet, it may be:
Code:
=SUM(IF($P$2:$P$88=R2,1,0))/2
on another. This is all fine if I use regular MyRange.End(xlDown) stuff, but the documentation (and all my stinking error messages) tell me that I need to use R1C1 format to create an arrayformula via VBA. My question is: how can I generate a R1C1 reference via VBA?
Thanks!