hybrid_concept
New Member
- Joined
- May 28, 2012
- Messages
- 15
So I have a fairly hefty formula that doesn't auto-fill the correct cells like simpler formulas would, if you dragged the corner of the cell across many. This formula uses VBAscript functions, and is:
=ColorFunction($C$4,Data!$C$450:$C$502,TRUE)+ColorFunction($C$4,Data!$H$450:$H$502,TRUE)+ColorFunction($C$4,Data!$M$450:$M$502,TRUE)
Basically, this function is first inserted on some row some ways down the C-column, and then needs to span across that same row over several columns to its right (D,E,F, etc, through to N). The part that needs to be replaced is "$C$4", which references cell C4 when the formula is is the C-column. The idea is to automagically change all three C4 references in the formula to D4 when the formula is input in the D column, etc, all the way through to the N-column.
As I said, merely dragging the corner of the starter cell does not work, it simply creates a verbatim copy of the entire formula over the many columns that it is dragged across, leaving it to be manually edited. Can this be done with VBA or is there another way?
=ColorFunction($C$4,Data!$C$450:$C$502,TRUE)+ColorFunction($C$4,Data!$H$450:$H$502,TRUE)+ColorFunction($C$4,Data!$M$450:$M$502,TRUE)
Basically, this function is first inserted on some row some ways down the C-column, and then needs to span across that same row over several columns to its right (D,E,F, etc, through to N). The part that needs to be replaced is "$C$4", which references cell C4 when the formula is is the C-column. The idea is to automagically change all three C4 references in the formula to D4 when the formula is input in the D column, etc, all the way through to the N-column.
As I said, merely dragging the corner of the starter cell does not work, it simply creates a verbatim copy of the entire formula over the many columns that it is dragged across, leaving it to be manually edited. Can this be done with VBA or is there another way?