Forum Discussion
Carlos Spörk
Apr 26, 2019Brass Contributor
Issue in VBA Function to copy the formula result in one cell and paste as a value into another cell
The Function below copies a formula result from one cell and pastes it as a value into a different cell in the same worksheet. I expected to store this Function in an .xlam file in order to avoid sav...
- Apr 29, 2019Functions called from a formula in a cell cannot make changes to any other cells, they return their result to the cell that uses the function in its formula.
JKPieterse
Apr 30, 2019Silver Contributor
It does not matter where this code is located, as long as it is called from a worksheet function it cannot affect other cells than the one it was called from. Period. But you can write a sub which does what you need and call that in an add-in or in your personal macro workbook.
Carlos Spörk
Apr 30, 2019Brass Contributor
I realize now that my initial reply was not clear enough. My apologies. I had already understood that an Excel function invoked from a cell in a worksheet can not modify other cells.
On the other hand, I already tried the workaround you suggested, and it obviously works. Thank you so much!
Cheers.
On the other hand, I already tried the workaround you suggested, and it obviously works. Thank you so much!
Cheers.