+ Reply to Thread
Results 1 to 4 of 4

crate formula in VBA

  1. #1
    Registered User
    Join Date
    06-01-2005
    Posts
    7

    crate formula in VBA

    Hello,

    is there a possibility to create an own formula in VBA, so that it can be used in the spreadsheet like e.g. SUM(),TAN(), or ...

    Thanks.

  2. #2
    Bob Phillips
    Guest

    Re: crate formula in VBA

    Activecell.Formula = "=SUM(A1:A10)"

    etc.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Tadashii" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hello,
    >
    > is there a possibility to create an own formula in VBA, so that it can
    > be used in the spreadsheet like e.g. SUM(),TAN(), or ...
    >
    > Thanks.
    >
    >
    > --
    > Tadashii
    > ------------------------------------------------------------------------
    > Tadashii's Profile:

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




  3. #3
    NickHK
    Guest

    Re: crate formula in VBA

    Tadashii,
    You mean a User Defined Function (UDF) ?

    In a Standard module, something like:
    Public Function MyFunction (ArgIn As Long) As String
    MyFunction = "You are " & ArgIn & " years old."
    End Function

    Then call it from a worksheet cell. e.g,
    A1: =MyFunction(1000)

    NickHK

    "Tadashii" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hello,
    >
    > is there a possibility to create an own formula in VBA, so that it can
    > be used in the spreadsheet like e.g. SUM(),TAN(), or ...
    >
    > Thanks.
    >
    >
    > --
    > Tadashii
    > ------------------------------------------------------------------------
    > Tadashii's Profile:

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




  4. #4
    Registered User
    Join Date
    06-01-2005
    Posts
    7
    That's exactly what i need thanks NickHK

+ 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