goalseek

  1. V

    VBA for looping GoalSeek based on If Then

    Hi Have been learning VBA for ~24 hrs, so apologies what may be a straightforward question, but I am trying to write a code for the following: I have the following rows of data in my sheet: Row 21 in my sheet is a row of binary flag that either equals 1 or 0 Row 35 is a row of input values...
  2. A

    Goal Seek Not working

    Hi, I am new to the forum and looking for some help... I am stuck!!:mad::confused: I am trying to use goal seek for a spreadsheet I am working on. When I use it i get a message that says "Goal Seeking with cell F4 may not have found a solution. The strange thing here is that when I do the maths...
  3. T

    Automate goal seek in two separate worksheets?

    Hi, I have a model that takes inputs to calculate the estimated cost of a new building. A second output is the estimated monthly payment to finance that cost. This output is based on one of two financing options, which a user selects from a drop down menu. The calculations for that monthly...
  4. M

    Goalseek doesn't work within VBA loop

    Hi All, I've got a goalseek within a VBA loop which comes up with an error. It works in isolation, and I've checked the obvious things like the cells in the goalseek linking and being formulae. I've turned auto-calc off, would this have an effect? Code below, bit where is goes wrong is...
  5. S

    VBA Goalseek inside for loop

    Hello everyone. I'm fairly new to coding so bear with me. I have written a small goalseek code inside a for next loop. When the code runs I get an error at the end, probably because some other values in the sheet goes to zero before goalseek can do all the calculations. The error is Run-time...
  6. M

    Skip a Cell if Two Cells equal one another

    I have this VBA, which is great, but in order to optimize it, I was wondering if there was a way to skip cells if two cells equal one another? here is the code: Private Sub Worksheet_Change(ByVal Target As Excel.Range) With Target If .Row = 248 And .Column > 7 And .Column < 556 Then...
  7. M

    VBA Goal Seek Procedure Too Large

    Hi, I am very new to VBA and my piece-mailing some code I found through various forums, I was able to get my VBA Goal Seek to work. However, I have too many cells I want to goal seek. I've looked into how to try to sub routine my VBA but I'm completely lost. Any help is very appreciated...
  8. K

    Custom VBA solver/goalseek function?

    Hi, I need a non-invasive custom VBA solver/goalseek function as follows: SOLVE(Output_Cell, Target_Value, Input_Cell) This would give the hypothetical value of the input cell that would give the target value in the output cell, but without actually changing the value in the input cell. It...
  9. J

    Adding GoalSeek into VBA with If Statement

    I'm a total VBA noob but for the workbook I'm making VBA seemed like the only thing that to get rid of the manual processes. I can't seem to find exactly how I would create or add something like this into my code. What I am doing: Running XIRR on hundred plus items. I built a sheet that runs...
  10. G

    Macro goal seek with changing cell avoiding negative values

    Hello guys, I am doing a simple goal seek in VBA but I want that if the changing cell should be negative it appears a cero instead. I mean, limit the changing cell to 0 or positive numbers and avoid negative numbers. This is the macro that I am using: Range(A3).GoalSeek Goal:=Range(A2).Value...
  11. P

    multiple iterations for a pair of goalseeks

    Sub Macro1() ' ' Macro1 Macro ' ' Keyboard Shortcut: Ctrl+g ' Range("g68").GoalSeek Goal:=Range("g61"), ChangingCell:=Range("g63") End Sub Sub Macro2() ' ' Macro2 Macro ' ' Keyboard Shortcut: Ctrl+g ' Range("g78").GoalSeek Goal:=Range("g71"), ChangingCell:=Range("g73") End Sub hi. i have the...
  12. P

    VBA goalseek on many columns of data

    hello. i have a corkscrew set up that stretches/repeats over 120 columns of data. i created a basic macro in VBA using the following syntax Sub Macro1() ' ' Macro1 Macro ' ' Keyboard Shortcut: Ctrl+g ' Range("g68").GoalSeek Goal:=Range("g61"), ChangingCell:=Range("g63") End Sub the...
  13. B

    Bulk Goal Seek Macro Breaks when encountering Blank Value

    Hello guys, Been a long time lurker of this amazing site. Lots of great resources. I need to do a goal seek on a large excel file line by line. I found the following Macro module that helps automate the process: Sub BulkGoalSeek() Dim C As Range For Each C In Range("A2:A10")...
  14. E

    Create input box in VBA for Goal Seek

    I'm having trouble with my code for goal seek. It should be asking for input for the goal cell, but taking ranges for the other inputs. My cell G5/y has a formula. Using GoalSeek outside of VBA works perfectly. But using this code, I get a 1004 error "Reference Not Valid". The error highlights...
  15. J

    Goalseek fails when called from a subroutine

    I have a macro which I use to do multiple Goalseeks in one go (one at a time). It normally works a treat, but in the model I'm working on at the moment, it's failing, because there are some UDFs in the sheet which are evaluating to #VALUE as soon as I run my macro. Goalseek works fine when I...
  16. A

    VBA MAcro HELP

    Hey guys. I need help for the following. I am SURE there is a faster code but I am new to coding and do not really know the commands for what I need to do. Below is the coding that I have now. ___________________________________________________________ Sub Solver() ' ' Solver Macro ' '...
  17. B

    VBA GoalSeek Comparion

    I'm relatively new to excel and have been having an issue with some vba in this model i'm working on.... Essentially I want to run 3 goalseeks on the same dynamic variable (L63) and return the minimum value goalseek finds. The following are the procedures for each goalseek: <!--[if gte mso...
  18. D

    Goal seek with Variable

    Beginner here trying to get goal seek to work for my needs. I would like the goal to be a var because it changes based on a pipe size which correlates to a specific slope to be used in the goal seek. Can this be done? The code below does not work. But it was what I was thinking. Sub...
  19. J

    Automatic GoalSeek With Calculated Target.Address

    Hi. I'm very new to VBE, and while I've almost got an automatic GoalSeek function worked out, there's one last problem that I can't seem to find a way around (or a thread that covers it). As it stands, I can manually enter a value in cell B4 of the sheet with my GoalSeek function, and Excel...
  20. A

    Create own function performing GoalSeek calculations

    I'm trying to write a function that adjusts a parameter using GoalSeek with the "setCell", "changingCell" and "Goal" as input parameters: Function Adjust (SetCell As Range, GoalValue As Double, ChangingCell As Range) As Boolean Adjust = SetCell.GoalSeek(GoalValue, ChangingCell) End Function...

Watch MrExcel Video

This Week's Hot Topics

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top