+ Reply to Thread
Results 1 to 4 of 4

Yet another basic problem

  1. #1
    Vepa
    Guest

    Yet another basic problem

    Hi,

    I have a very basic question concerning the VBA code in excel. I would like
    to know how can I decide into which cell does the excel enter the answer of
    my function?

    For example, if my function goes as follows,
    function test(s+b)
    test=s+b
    end function

    so how can i tell the program that the result of the function should be
    shown automatically in cell e.g "C2"?

    Regards,
    Vepa


  2. #2
    NickHK
    Guest

    Re: Yet another basic problem

    Vepa,
    First, to write your function, you need to separate the arguments:
    Public function test (arg1 as range, arg2 as range)
    ....etc

    Then you have to enter the function and arguments in cell C2.
    =test(A1,C14)

    same as you do for any other Excel WS formula.

    NickHK

    "Vepa" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I have a very basic question concerning the VBA code in excel. I would

    like
    > to know how can I decide into which cell does the excel enter the answer

    of
    > my function?
    >
    > For example, if my function goes as follows,
    > function test(s+b)
    > test=s+b
    > end function
    >
    > so how can i tell the program that the result of the function should be
    > shown automatically in cell e.g "C2"?
    >
    > Regards,
    > Vepa
    >




  3. #3
    Vepa
    Guest

    Re: Yet another basic problem

    So is it impossible for me to do, for example, a result table where all the
    results of calculations involved in the function could be shown
    automatically? With this I mean that I donÂīt have to do everything manually
    by using normal excel functions.

    "NickHK" kirjoitti:

    > Vepa,
    > First, to write your function, you need to separate the arguments:
    > Public function test (arg1 as range, arg2 as range)
    > ....etc
    >
    > Then you have to enter the function and arguments in cell C2.
    > =test(A1,C14)
    >
    > same as you do for any other Excel WS formula.
    >
    > NickHK
    >
    > "Vepa" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi,
    > >
    > > I have a very basic question concerning the VBA code in excel. I would

    > like
    > > to know how can I decide into which cell does the excel enter the answer

    > of
    > > my function?
    > >
    > > For example, if my function goes as follows,
    > > function test(s+b)
    > > test=s+b
    > > end function
    > >
    > > so how can i tell the program that the result of the function should be
    > > shown automatically in cell e.g "C2"?
    > >
    > > Regards,
    > > Vepa
    > >

    >
    >
    >


  4. #4
    Niek Otten
    Guest

    Re: Yet another basic problem

    <to do, for example, a result table >

    Look at the Data>Table command

    Or try to explain a bit more clearly what you are trying to achieve, so we
    can suggest alternative ways to do that.

    --
    Kind regards,

    Niek Otten

    "Vepa" <[email protected]> wrote in message
    news:[email protected]...
    > So is it impossible for me to do, for example, a result table where all
    > the
    > results of calculations involved in the function could be shown
    > automatically? With this I mean that I donīt have to do everything
    > manually
    > by using normal excel functions.
    >
    > "NickHK" kirjoitti:
    >
    >> Vepa,
    >> First, to write your function, you need to separate the arguments:
    >> Public function test (arg1 as range, arg2 as range)
    >> ....etc
    >>
    >> Then you have to enter the function and arguments in cell C2.
    >> =test(A1,C14)
    >>
    >> same as you do for any other Excel WS formula.
    >>
    >> NickHK
    >>
    >> "Vepa" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > Hi,
    >> >
    >> > I have a very basic question concerning the VBA code in excel. I would

    >> like
    >> > to know how can I decide into which cell does the excel enter the
    >> > answer

    >> of
    >> > my function?
    >> >
    >> > For example, if my function goes as follows,
    >> > function test(s+b)
    >> > test=s+b
    >> > end function
    >> >
    >> > so how can i tell the program that the result of the function should be
    >> > shown automatically in cell e.g "C2"?
    >> >
    >> > Regards,
    >> > Vepa
    >> >

    >>
    >>
    >>




+ 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