How do I set a goalseek value via an input box using vba macro

T

TJK

code = Range("J22").GoalSeek Goal:=myNum = Application.InputBox("Enter a
number"), ChangingCell:=Range("C5")
The input box will fire up but will not use the input value as the value
in the goalseek calc.
 
G

Gary''s Student

Sub Macro2()
x = Application.InputBox("give me a goal")
Range("C5").GoalSeek Goal:=x, ChangingCell:=Range("A1")
End Sub
 
Top