×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Goal Seek Excel
2

Goal Seek Excel

Goal Seek Excel

(OP)
thread770-224290: Automatic goal seek

Hello handleman

My question is similar to the thread  but it is a very basic question to do with incorporating your goal seek code into Excel in the so it runs automatically each time cells are changed instead of having to run a macro

My example

Goal seek by Setting cell C6 to 5,000  by changing A5

What I need to know is where you insert the VBA code – it does not work when I simply paste your code in the macro editor for an existing recorded macro. So I would be very grateful if you could assume that I am starting from scratch and have no macro at all and outline the steps I need to take as a basic excel user

Thanks
 

RE: Goal Seek Excel

Here's one I use to iterate thru the Fanning Friction Factor.
This would be in the worksheet VBA & a "selectionchange"

Private Sub Worksheet_Calculate()
  If IsNumeric(Range("error")) Then
  If Range("error") <> 0 Then
    Range("error").GoalSeek Goal:=0.0000000001, ChangingCell:=Range("assum_F")
  End If
  End If
End Sub

RE: Goal Seek Excel

(OP)
Thanks Psafety

Unforunately I do not program in VBA so Could you please outline in a step by step manner what I need to do in Excel/VBA editor/macro to have an automatic  goal seak update in an excel worksheet using teh example I gave . Thanks again

RE: Goal Seek Excel

Private Sub Worksheet_Calculate()
Private Sub Worksheet_Calculate()
  If IsNumeric(Range("c6")) Then
  If Range("c6") <> 5000 Then
    Range("c6").GoalSeek Goal:=5000, ChangingCell:=Range("a5")
  End If
  End If
End Sub  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources