spurs
Active Member
- Joined
- Oct 18, 2006
- Messages
- 479
- Office Version
- 2016
- 2013
- 2010
- 2007
- 2003 or older
- Platform
- Windows
I need to use an excel function instead of a sub because using a function allows Excels internal goal seek to still work.
My desired function - simplified here has in this case 2 inputs but I not only want the function to output in the active cell but also to other cells
Here is my intent but it does not work
If I comment out the 2 lines with "Sheets" it obviously returns the value test into the active cell
But i need a function to also output to 2 other cells.
How can I achieve that?
Function Test(A,B)
Test = A * B
Sheets("Sheet1").Range("B1") = A ^ 2
Sheets("Sheet1").Range("B2") = B ^ 3
End Function
In my real function, the calculations are much more complex and iterative, so its not possible just to do cell entries
My desired function - simplified here has in this case 2 inputs but I not only want the function to output in the active cell but also to other cells
Here is my intent but it does not work
If I comment out the 2 lines with "Sheets" it obviously returns the value test into the active cell
But i need a function to also output to 2 other cells.
How can I achieve that?
Function Test(A,B)
Test = A * B
Sheets("Sheet1").Range("B1") = A ^ 2
Sheets("Sheet1").Range("B2") = B ^ 3
End Function
In my real function, the calculations are much more complex and iterative, so its not possible just to do cell entries