+ Reply to Thread
Results 1 to 3 of 3

Function query

  1. #1
    Rahul
    Guest

    Function query

    Hi

    I am writing an excel function in VBA for calculating Future Value of a
    selected range, where 1st cell is year1 and 2nd cell is year 2 and so on(i
    know already there is in built function for FV, but i need this as part of
    larger function i am writing)

    My code starts as follows:
    Public Function FutureValue(Rate As Double, CashFlow As Range) As Double

    CashFlow is selected as a range which can be any number of cells (say 5 or
    10 or 20,etc). Now i need to know how many cells have been selected. I tried
    using Ubound(CashFlow) but that returns an error.

    Please help, its urgent!!

    Thanks a lot



  2. #2
    sebastienm
    Guest

    RE: Function query

    Hi,

    Number of cell within a range: CashFlow.Cells.Count
    --
    Regards,
    Sébastien
    <http://www.ondemandanalysis.com>


    "Rahul" wrote:

    > Hi
    >
    > I am writing an excel function in VBA for calculating Future Value of a
    > selected range, where 1st cell is year1 and 2nd cell is year 2 and so on(i
    > know already there is in built function for FV, but i need this as part of
    > larger function i am writing)
    >
    > My code starts as follows:
    > Public Function FutureValue(Rate As Double, CashFlow As Range) As Double
    >
    > CashFlow is selected as a range which can be any number of cells (say 5 or
    > 10 or 20,etc). Now i need to know how many cells have been selected. I tried
    > using Ubound(CashFlow) but that returns an error.
    >
    > Please help, its urgent!!
    >
    > Thanks a lot
    >
    >


  3. #3
    Rahul
    Guest

    RE: Function query

    It works:-)
    Thanks a ton!!


    "sebastienm" wrote:

    > Hi,
    >
    > Number of cell within a range: CashFlow.Cells.Count
    > --
    > Regards,
    > Sébastien
    > <http://www.ondemandanalysis.com>
    >
    >
    > "Rahul" wrote:
    >
    > > Hi
    > >
    > > I am writing an excel function in VBA for calculating Future Value of a
    > > selected range, where 1st cell is year1 and 2nd cell is year 2 and so on(i
    > > know already there is in built function for FV, but i need this as part of
    > > larger function i am writing)
    > >
    > > My code starts as follows:
    > > Public Function FutureValue(Rate As Double, CashFlow As Range) As Double
    > >
    > > CashFlow is selected as a range which can be any number of cells (say 5 or
    > > 10 or 20,etc). Now i need to know how many cells have been selected. I tried
    > > using Ubound(CashFlow) but that returns an error.
    > >
    > > Please help, its urgent!!
    > >
    > > Thanks a lot
    > >
    > >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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