Results 1 to 3 of 3

Thread: [RESOLVED] Excel 97 User defined function?

  1. #1

    Thread Starter
    Addicted Member Guru's Avatar
    Join Date
    May 2000
    Location
    sulking in the cupboard under the stairs
    Posts
    237

    Resolved [RESOLVED] Excel 97 User defined function?

    in the VB editor on Sheet1 I've put this code:

    Function xx()
    xx = "hello"
    End Function


    in a cell on sheet one I've got

    =Sheet1.xx()


    I selected this from the insert -> function -> user defined list
    and I get an error saying that the name isn't valid

    WHY?



    Thanks
    Another light-hearted post from Guru

  2. #2
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Excel 97 User defined function?

    You cannot put a User Defined function in the Sheet (in the code view). Put the function in a Module. Go to the Code view and INsert a module. Then write your function. THen you could use it like this
    Code:
    =xx()
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  3. #3

    Thread Starter
    Addicted Member Guru's Avatar
    Join Date
    May 2000
    Location
    sulking in the cupboard under the stairs
    Posts
    237

    Resolved Re: Excel 97 User defined function?

    Yay! Thanks

    Another light-hearted post from Guru

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width