ferehealthy.blogg.se

Goal seek excel
Goal seek excel













Link this to the cell that Excel can change. This cell must be a link. “By Changing Cell” is the cell that Excel can change to achieve the goal.This VBA Macro is a bit advanced in that it pulls the value of the cell, regardless of if it is a formula or not.) (For those who are familiar with the Goal Seek function, Excel by default require this input to be value, and cannot be a formula, even if the formula is linking to a value. This can be either a value or formula in the Input sheet. Excel will try to make the cell in “Set Cell” to turn to the goal. This cell must be a link. Can be on a different page.

goal seek excel

Link this to the cell you are trying to set to a certain value. “Set Cell” is the cell that you want to get to a certain value.'now that all the inputs are set, perform goal seek operation Set changing_cell_range = Range(ws_input.Cells(i, 3).Formula)

goal seek excel

Even if the cell is a formula, it is ok! (Originally, goal Seek does not allow this cell to be a formula.) To_value_val = ws_input.Cells(i, 2).Value 'find the value of cell. Set to_value_range = Range(ws_input.Cells(i, 2).Formula) Set set_cell_range = Range(ws_input.Cells(i, 1).Formula) Num_rows = ws_input.Cells(ws_, 1).End(xlUp).Rowĭim set_cell_range As Range, to_value_range As Range, changing_cell_range As Rangeįor i = 2 To num_rows 'i starts at 2 because we assume 1st row is label Set ws_input = ThisWorkbook.Worksheets("input")















Goal seek excel