ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I set a goalseek value via an input box using vba macro (https://www.excelbanter.com/excel-worksheet-functions/155559-how-do-i-set-goalseek-value-via-input-box-using-vba-macro.html)

TJK

How do I set a goalseek value via an input box using vba macro
 
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.

Gary''s Student

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.



All times are GMT +1. The time now is 08:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com