+ Reply to Thread
Results 1 to 3 of 3

Macro to generate values until condition between 2 cell is met

  1. #1
    Registered User
    Join Date
    03-01-2016
    Location
    Ottawa
    MS-Off Ver
    365
    Posts
    7

    Question Macro to generate values until condition between 2 cell is met

    Hi folks, second time I need your help. This is the last one though and the project is done
    I have a cell (B18) in which a number must be entered.
    That number will be used as a denominator in cells (F19:K19)
    The sum of INT (F19:K19) which are in (F20:K20) must equal a predefine value set in cell E20.
    I would like the user the press a macro button that will generate the proper value in cell B18 for this condition to be meet. I know that the value to be generated in B18 is in the vicinity of the value in A18.

    I have join the file. Can someone help please? Thanks to the community. Very appreciated.
    Attached Files Attached Files
    Last edited by _Mani__; 03-03-2016 at 05:12 PM.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Macro to generate values until condition between 2 cell is met

    So your question basically boils down to this style formula (dummy values just to illustrate a point). However, I don't know how to solve for x in this situation, even though by trail and error (not algebra) I can see that one possible solution for x is x = 2.1, though there's a range of values that work.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    So this code is... ugh. Not the real way to solve this problem, and I can't even be sure it works in all situations. Takes about 2 seconds to run, but still. Really hope somebody knows how to do this algebraically!
    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    03-01-2016
    Location
    Ottawa
    MS-Off Ver
    365
    Posts
    7

    Re: Macro to generate values until condition between 2 cell is met

    I don't think there is an algebric way to solve it. But your code works. Thanks a lot for your help.

+ 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. Generate hyperlink based on cell contents, end when condition met
    By PompadourJay in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-10-2014, 03:27 PM
  2. Macro - Get adjacent cell values based on a condition & save as a different workbook
    By ManInRed in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-14-2013, 10:25 AM
  3. Replies: 2
    Last Post: 12-14-2012, 01:17 PM
  4. [SOLVED] Macro to generate a list of values
    By Uzzgee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2012, 06:31 PM
  5. Macro to generate random cell values by pct
    By rbpd5015 in forum Excel General
    Replies: 4
    Last Post: 09-02-2010, 03:32 PM
  6. Macro needed to add values to a cell in excel IF(condition)
    By netrisca in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2009, 01:30 PM
  7. Generate Zero Based On Other Cell Values.
    By mikello in forum Excel General
    Replies: 3
    Last Post: 08-04-2009, 09:19 AM
  8. generate statement with cell values
    By kaffal in forum Excel General
    Replies: 0
    Last Post: 01-05-2009, 11:53 AM

Tags for this Thread

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