+ Reply to Thread
Results 1 to 3 of 3

VBA to optimize outflows

  1. #1
    Registered User
    Join Date
    08-28-2017
    Location
    Unknow
    MS-Off Ver
    2016
    Posts
    9

    VBA to optimize outflows

    Hi all,

    I am trying to calculate a liquidity based on expected inflows and working capital threshold.

    In the attached workbook, Row 24 is being calculated via formula before a threshold check. I want a macro that checks if a value in any cell in the range (C27: L27) exceeds working capital threshold which is 50M.

    If it does, like in H27, the macro should calculate the exceeding amount (95,420,906 - 50,000,000 = 45,420,906) and start deducting it from the most recent periods in Row24 until the value in the cell, where the threshold breached, reaches 50M. However, the value in Row 24 cannot be less than 0. There could be multiple cells where the threshold exceeds so the macro should continue to check until all the values in the range (C27: L27) are equal to or less than 50M

    I have manually calculated the Row24 in the 'After' sheet of the attached workbook.

    These numbers are dynamic and the threshold can exceed in any of the cells in the range (C27: L27).

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: VBA to optimize outflows

    Try:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    08-28-2017
    Location
    Unknow
    MS-Off Ver
    2016
    Posts
    9

    Re: VBA to optimize outflows

    Thanks alot!

+ 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. Need Cumulative running totals that never fall below zero despite outflows
    By YukonSoDank in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-23-2019, 04:13 PM
  2. How can I optimize my code
    By viettest in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-08-2019, 05:02 PM
  3. [SOLVED] Optimize my VBA code
    By modytrane in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-07-2019, 11:25 AM
  4. VBA to optimize your VBA possible?
    By alexgoaga in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2017, 05:37 AM
  5. Optimize code
    By DarkKnightLupo in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-19-2014, 08:58 AM
  6. Replies: 2
    Last Post: 08-14-2013, 11:03 AM
  7. How to optimize
    By jonelamora in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 07-04-2012, 02:17 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