Don't know if this helps.
To avoid getting the #ref error, select the range with the formula results, put your cursor near to the upper limit of the selection ( it will become an arrow), and holding the right button of your mouse , drag your selection to a location ( can be the same from where you started the idea is that you move around a bit).
When you release the button a menu will pop up stating " Copy here as values only" ( among other things).
Choose this option, and you can delete any precedents if necessary.
If you record a small macro to do this, you are in business