View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default How do I set a goalseek value via an input box using vba macro

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

--
Gary''s Student - gsnu200739


"TJK" wrote:

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.