I created a part of a sheet that refers to other parts of the sheet and to parts of another sheet. There is a mix of partially explicit (A$4, $B2), explicit ($A$4), and non explicit (A4) references within a formula. For example:
=IF(AB$4>$J8,0,IF(B8=$K8,0,SUM(INDEX(Masterdata!$A$1:$CA$90,MATCH($A8,Masterdata!$A$1:$A$90,0),B8+32):INDEX(Masterdata!$A$1:$CA$90,MATCH($A8,Masterdata!$A$1:$A$90,0),$K8+31))))
There are dozens of this type of formula throughout the sheet.
I want to take that part and move it to another sheet for display purposes. However as you can guess any relative references get skewed and the formula breaks.
Is there a way to convert all cell references to an explicit reference with sheet name, e.g. $k8 -> Input!$k$8
?
Or do I have a few hours of tedious work ahead of me?
Edit to try and comply with the on hold flag:
I have 50 cells with formulas like
=IF(AB$4>$J8,0,IF(B8=$K8,0,SUM(INDEX(Masterdata!$A$1:$CA$90,MATCH($A8,Masterdata!$A$1:$A$90,0),B8+32):INDEX(Masterdata!$A$1:$CA$90,MATCH($A8,Masterdata!$A$1:$A$90,0),$K8+31))))
I would like to cut and paste these cells and move to another sheet. In doing so, I need to change all references to other cells in the formulas to be explicit and to include sheet name. Above formula would then become:
=IF(Input!$AB$4>Input!$J$8,0,IF(Input!$B$8=Input!$K$8,0,SUM(INDEX(Masterdata!$A$1:$CA$90,MATCH(Input!$A$8,Masterdata!$A$1:$A$90,0),Input!$B$8+32):INDEX(Masterdata!$A$1:$CA$90,MATCH(Input!$A$8,Masterdata!$A$1:$A$90,0),Input!$K$8+31))))
.
After the conversion of all the formulae, I will then be able to Cut the range and then paste it anywhere on another page. Using paste as "link" is viable, but would require the original range to stay in place, and that, in my opinion, would be sloppy and feels like cheating.
Can code be made that can look at a cell, see if there is a formula in it, determine if there are ranges referenced, set them as explicit references if not already one, see if there is already a sheet reference and if there isn't add one? Each formula will be unique and will vary in length and type.