+ Reply to Thread
Results 1 to 2 of 2

Is it possible with functions?

  1. #1
    Registered User
    Join Date
    07-08-2004
    Posts
    11

    Exclamation Is it possible with functions?

    Great Day!
    I have a user defined function in a cell A1 and I would like to return value to the cell B2

    For example if I have function:

    Public Function MyTest(ByVal sInput As String)
    Application.Range("MyRange") = sInput
    End Function

    If I put this function in to cell A1 and name cell B2 “MyRange” then I get an application error.

    Thank you.
    Compound.

  2. #2
    Elkar
    Guest

    RE: Is it possible with functions?

    No, a function (user-defined or not) can only return a value to the cell that
    it is used in. A Workbook SheetChange event macro may accomplish what you're
    looking for, but not a function.

    Its not clear what you're trying to accomplish, but why not place a formula
    in B2 that performs a calculation on data in A1? Would this not give you
    your desired results?

    HTH,
    Elkar


    "compound" wrote:

    >
    > Great Day!
    > I have a user defined function in a cell A1 and I would like to return
    > value to the cell B2
    >
    > For example if I have function:
    >
    > Public Function MyTest(ByVal sInput As String)
    > Application.Range("MyRange") = sInput
    > End Function
    >
    > If I put this function in to cell A1 and name cell B2 “MyRange” then I
    > get an application error.
    >
    > Thank you.
    > Compound.
    >
    >
    > --
    > compound
    > ------------------------------------------------------------------------
    > compound's Profile: http://www.excelforum.com/member.php...o&userid=11556
    > View this thread: http://www.excelforum.com/showthread...hreadid=555131
    >
    >


+ 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