Excel VBA Goalseek -
i trying leverage goalseek command in vba in excel spreadsheet. have value in f3, f7, , f18. when change value in f3 error back:
run-time error '1004': reference not valid
here code
private sub worksheet_change(byval target range) worksheets("mdl") if target = range("f3") range("f3").goalseek goal:=range("f7"), changingcell:=range("f18") end if end end sub
the goalseek requires formula in cell creating it, if change range("f3") value instead of formula error appear.
Comments
Post a Comment