I'm trying to automate a calculation using Goal Seek function via VBA, which is trying to change Diameterindv/P/c16 until it makes QFuld/R/c18 larger than Q Max/N/c14. R is a formular that calculates the flow based on the diameter in P. This must be larger than the nescesarry incoming flow in N.
I've added a screenshot and a bit of code. However when running the below code, I often get weird results (large negative numbers among them). Example is when running the code P is suddenly -63082144,16.
I'm wondering if it's possible for Goal Seek to only seek in prespecified numbers/range? For instance, I only want the numbers it can use as a solution to be 188, 235, 297, 377, 500, 600.
Current wrong result:
RfAaJ.png
Desired result in red:
jE7ig.png
I've added a workbook, in the Workbook it's the button "Beregn Indv", that runs Module 3.
Bookmarks