+ Reply to Thread
Results 1 to 7 of 7

Using Excel function with variable

  1. #1
    Registered User
    Join Date
    12-08-2005
    Posts
    19

    Question Using Excel function with variable

    Could I use excel function when I don't know the range and I need to define it with variable.
    If it possible, how I do it?
    Thanks

  2. #2
    Steve Dalton
    Guest

    Re: Using Excel function with variable

    Yes, using the INDIRECT function. But you need to know that this is
    volatile.

    Regards

    Steve Dalton

    "ditzafar" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Could I use excel function when I don't know the range and I need to
    > define it with variable.
    > If it possible, how I do it?
    > Thanks
    >
    >
    > --
    > ditzafar
    > ------------------------------------------------------------------------
    > ditzafar's Profile:

    http://www.excelforum.com/member.php...o&userid=29475
    > View this thread: http://www.excelforum.com/showthread...hreadid=497502
    >




  3. #3
    Registered User
    Join Date
    12-08-2005
    Posts
    19

    Question

    What do you mean by indirect function.
    thanks

    Quote Originally Posted by Steve Dalton
    Yes, using the INDIRECT function. But you need to know that this is
    volatile.

    Regards

    Steve Dalton

    "ditzafar" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Could I use excel function when I don't know the range and I need to
    > define it with variable.
    > If it possible, how I do it?
    > Thanks
    >
    >
    > --
    > ditzafar
    > ------------------------------------------------------------------------
    > ditzafar's Profile:

    http://www.excelforum.com/member.php...o&userid=29475
    > View this thread: http://www.excelforum.com/showthread...hreadid=497502
    >

  4. #4
    Niek Otten
    Guest

    Re: Using Excel function with variable

    If you mean a User defined Function (UDF):

    Function DemoSum(a As Range) As Double
    DemoSum = a.Count
    End Function

    --
    Kind regards,

    Niek Otten

    "ditzafar" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Could I use excel function when I don't know the range and I need to
    > define it with variable.
    > If it possible, how I do it?
    > Thanks
    >
    >
    > --
    > ditzafar
    > ------------------------------------------------------------------------
    > ditzafar's Profile:
    > http://www.excelforum.com/member.php...o&userid=29475
    > View this thread: http://www.excelforum.com/showthread...hreadid=497502
    >




  5. #5
    Bob Phillips
    Guest

    Re: Using Excel function with variable

    See response in other thread

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "ditzafar" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Could I use excel function when I don't know the range and I need to
    > define it with variable.
    > If it possible, how I do it?
    > Thanks
    >
    >
    > --
    > ditzafar
    > ------------------------------------------------------------------------
    > ditzafar's Profile:

    http://www.excelforum.com/member.php...o&userid=29475
    > View this thread: http://www.excelforum.com/showthread...hreadid=497502
    >




  6. #6
    Registered User
    Join Date
    12-08-2005
    Posts
    19

    Thumbs down

    Sorry, but I stille didn't understand how I using excel function with variable.
    For example I want to use the function average. the recorde of this macro looks like this
    ActiveCell.FormulaR1C1 = "=AVERAGE(R[-6]C[-6]:R[3]C[-6])"
    I want to replace the index of the row with variable
    thanks

    Quote Originally Posted by Niek Otten
    If you mean a User defined Function (UDF):

    Function DemoSum(a As Range) As Double
    DemoSum = a.Count
    End Function

    --
    Kind regards,

    Niek Otten

    "ditzafar" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Could I use excel function when I don't know the range and I need to
    > define it with variable.
    > If it possible, how I do it?
    > Thanks
    >
    >
    > --
    > ditzafar
    > ------------------------------------------------------------------------
    > ditzafar's Profile:
    > http://www.excelforum.com/member.php...o&userid=29475
    > View this thread: http://www.excelforum.com/showthread...hreadid=497502
    >

  7. #7
    Niek Otten
    Guest

    Re: Using Excel function with variable

    ActiveCell.FormulaR1C1 = "=AVERAGE(R[-" & VaraRowNo1 & "]C[-6]:R[" &
    VarRowNo2 & "]C[-6])"

    --
    Kind regards,

    Niek Otten

    "ditzafar" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Sorry, but I stille didn't understand how I using excel function with
    > variable.
    > For example I want to use the function average. the recorde of this
    > macro looks like this
    > ActiveCell.FormulaR1C1 = "=AVERAGE(R[-6]C[-6]:R[3]C[-6])"
    > I want to replace the index of the row with variable
    > thanks
    >
    > Niek Otten Wrote:
    >> If you mean a User defined Function (UDF):
    >>
    >> Function DemoSum(a As Range) As Double
    >> DemoSum = a.Count
    >> End Function
    >>
    >> --
    >> Kind regards,
    >>
    >> Niek Otten
    >>
    >> "ditzafar" <[email protected]>
    >> wrote in
    >> message news:[email protected]...
    >> >
    >> > Could I use excel function when I don't know the range and I need to
    >> > define it with variable.
    >> > If it possible, how I do it?
    >> > Thanks
    >> >
    >> >
    >> > --
    >> > ditzafar
    >> >

    >> ------------------------------------------------------------------------
    >> > ditzafar's Profile:
    >> > http://www.excelforum.com/member.php...o&userid=29475
    >> > View this thread:

    >> http://www.excelforum.com/showthread...hreadid=497502
    >> >

    >
    >
    > --
    > ditzafar
    > ------------------------------------------------------------------------
    > ditzafar's Profile:
    > http://www.excelforum.com/member.php...o&userid=29475
    > View this thread: http://www.excelforum.com/showthread...hreadid=497502
    >




+ 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