+ Reply to Thread
Results 1 to 5 of 5

calculating based on a range of variable depth (VBA)

  1. #1
    Registered User
    Join Date
    09-15-2011
    Location
    Tampa, Fl
    MS-Off Ver
    Excel 2010
    Posts
    3

    calculating based on a range of variable depth (VBA)

    Hi all, normally I have been able to stumble across my own solutions but am having trouble with this one. See attachment for reference. I am trying to have the excess cash flow line calculate as EBITDA less the sum of the expenses below. The first expense is always on line 6 and there are always the same number of years for this (C:J). The number of expenses is variable and could be anywhere from 3-10. This graph is being pulled from data on another page via VBA and should function without user input. This line is the only one I haven't been able to figure out.

    Please point me in the right direction as I have tried this from a few direction, with little success.

    Thanks for looking!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    04-01-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2010
    Posts
    280

    Re: calculating based on a range of variable depth (VBA)

    Assuming the number of rows below 6 are sequential then:

    Please Login or Register  to view this content.
    of course you could just use the SUM(C6:C16) and blanks would be ignored.

  3. #3
    Registered User
    Join Date
    09-15-2011
    Location
    Tampa, Fl
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: calculating based on a range of variable depth (VBA)

    Thanks, but it needs to be done in vb, not excel formula, and c16 isn't necessarily the end. There could be any number of expense items.

  4. #4
    Forum Contributor
    Join Date
    04-01-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2010
    Posts
    280

    Re: calculating based on a range of variable depth (VBA)

    This code will write the formula to the cell and then replace it with the values.
    Depending on how the rest of your VBA is written you may need to add sheet references and calculations to the code.

    Without seeing your code on how this sheet is created, this is my best guess at a solution.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-15-2011
    Location
    Tampa, Fl
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: calculating based on a range of variable depth (VBA)

    Thanks again. There are more rows below the total line though, so that end up thing won't work. the code snippet afterward looks promising though. when i get in front of it tomorrow i'll give it a shot and see if i can work again. thanks 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)

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