Hello,
This is similar to a previous post I had.
VBA to populate a textbox with a range sum
Again, I’m looking for a way to eliminate a cell reference only this time it is in a formula. This is a snipit of what I am doing. There is much more going on but I think if I can get this to work I’ll be going in the right direction.
Here’s what’s working:
There is another range of cells containing the following formula where the column remains the same but the row changes as the formula is copied down the range. As noted, the reference to cell $T$24 remains constant.
=IF(P33="",IF(YEAR(C33)=$T$24,Q33,0),0)
Maybe this is not possible but what I was hoping for was to eliminate the need to populate cell T24 and replace it with some code. I tried something like this (which I know is wrong).
=IF(P33="",IF(YEAR(C33)= (Range("T32").End(xlDown).Offset(1, -2).Value) ,Q33,0),0)
If this becomes too involved or complicated, I’ll just leave it as is.
Thanks for viewing,
Steve K.
This is similar to a previous post I had.
VBA to populate a textbox with a range sum
Again, I’m looking for a way to eliminate a cell reference only this time it is in a formula. This is a snipit of what I am doing. There is much more going on but I think if I can get this to work I’ll be going in the right direction.
Here’s what’s working:
VBA Code:
If Range("T33") > 0 Then
Range("T24") = Range("T32").End(xlDown).Offset(1, -2).Value
Else
Range("T24") = Range("R33")
End If
There is another range of cells containing the following formula where the column remains the same but the row changes as the formula is copied down the range. As noted, the reference to cell $T$24 remains constant.
=IF(P33="",IF(YEAR(C33)=$T$24,Q33,0),0)
Maybe this is not possible but what I was hoping for was to eliminate the need to populate cell T24 and replace it with some code. I tried something like this (which I know is wrong).
=IF(P33="",IF(YEAR(C33)= (Range("T32").End(xlDown).Offset(1, -2).Value) ,Q33,0),0)
If this becomes too involved or complicated, I’ll just leave it as is.
Thanks for viewing,
Steve K.