+ Reply to Thread
Results 1 to 2 of 2

Macro to run multiple goal seeks on different rows

  1. #1
    Registered User
    Join Date
    01-08-2019
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    1

    Macro to run multiple goal seeks on different rows

    Hi,

    I'm need of help for a macro to run multiple goal seeks on the same column but on different rows for a standard rental calculation. I've attached the excel template i'm working on.

    Column A is just the row numbers, the macro needs to run over a different number of rows as each sheet I have in my file has different row numbers. It could be 10 rows it could be 5,000 rows.

    Column B : this is a fixed rent amount (goal seek has to equal this rent amount), cannot change

    Column C : this is a fixed interest amount, cannot change

    Column D : fixed amount, cannot change

    Column E : this is a variable and CAN change

    Column F : this is a calculation

    Column G : calculation showing the difference. once the goal seek has finished I hope this cell to be 0


    the goal seek needs to set the cell in column F to equal the cell in column B by changing the cell in column E

    I hope this makes sense

    in the example I've shown 2 rows however the macro needs to continue on and run as many rows as I have



    very much appreciated your help!

    thanks
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,374

    Re: Macro to run multiple goal seeks on different rows

    I'm sure a macro could do this. Before exploring the macro programming, I would ask what the difference is between what you want the macro to do and the built in NPER() function? Each of the quantities in the PV formula has an Excel function. It looks like you are trying to find the number of periods [NPER()] that gives the desired payment at a given interest rate and present value. While it is certainly possible to program the spreadsheet to find the number of periods that makes PMT() equal a certain value, it seems easier to just use the NPER() function. Is there a reason you are avoiding the NPER() function?

    If it helps, as a test, I put =NPER(C5/12,B5,-D5,0,0) into E5 and G5 immediately returned 0. Copied down into row 6 and G6 also became 0, so it seems to work.

    Help file for the NPER() function: https://support.office.com/en-us/art...f-b6a38151d815
    Last edited by MrShorty; 01-09-2019 at 01:42 AM.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA goal seek multiple independent data sets with one macro
    By dballinger001 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-31-2018, 06:58 PM
  2. Goal Seek Multiple Rows after a calculated event
    By CSherman in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-04-2017, 09:40 AM
  3. Goal Seek vba for multiple rows
    By mmasonspg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-28-2016, 05:53 PM
  4. [SOLVED] Utter macro (and forum) noob seeks string fragment matching macro help
    By Knownowt in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-05-2015, 02:04 PM
  5. Goal Seek Macro for multiple lines
    By ksamarin88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2013, 08:04 AM
  6. Using Goal Seek in Macro to automatically change a cell value in multiple columns
    By Josiah in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2008, 05:56 AM
  7. [SOLVED] Newbie seeks suggestion on recording new macro to print sheets
    By Vivian in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-10-2006, 02:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1