I am trying to make simple thing in VBA but I cannot and it drives me crazy. Apologies but I am kinda new to VBA and I want to do it simplest way possible.
I have the following problem:
Sheets("Sheet1").Range("R4").goalseek goal:=1392, ChangingCell:=Sheets("Sheet1").Range("S4")
I wrote this line and it works. Now I would love to make it on passed variables
address.goalseek goal:=value, ChangingCell:=address2
Sub Whatever (address as Range, value as Double, address2 as Range)
address.goalseek goal:=value, ChangingCell:=address2
End Sub
and to be able to call function/sub from worksheet. Not sure if I should use sub or function. I have every month random(n)-lines that needs to be adjusted so I can not make it static. Tried plenty of things and they do not work.