PDA

Click to See Complete Forum and Search --> : [RESOLVED] Excel 97 User defined function?


Guru
Feb 10th, 2006, 03:21 AM
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

Shuja Ali
Feb 10th, 2006, 03:50 AM
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 =xx()

Guru
Feb 10th, 2006, 04:17 AM
Yay! Thanks

:thumb: