View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default User Defined Function Not Available In Other Worksheets

unfortunately, i'm just not seeing the light! hahaha.

i have opened up my VBE, and i can see the "tree" that you
referred to......i see a tree like this:

AutoSave.XLS
VBAProject(Import.xls)
VBAProject(PERSONAL.xls)

when i click on VBAProject(Import.xls), which is the what
i'm currently working on, i see the branches that you
referred to including Modules.

i have my code for the user defined function i built
stored there in the Module under VBAProject(Import.xls),
and i can use the function in this particular
project......but i am unable to use it in other projects.

where do i need to move it so that it will be globally
available? thank you. sorry if i'm becoming a pain.
-----Original Message-----
When you go to the VBE and view the project you will see:
A list of your projects (workbooks) if you have go to

the View menu
and Select Project Explore. This is a tree view

just like your
Explore window.
For each Project there are 4 possible 'folders' (you

may not see all)
Microsoft Excel Objects - these are the

worksheets plus another
for ThisWorkbook. These are 'class' modules

designed to hold
event code for the individual object

(workbook or sheet).
Modules - this contains the general/standard code

modules. This is
where your regular code should go.
Forms - if you build forms, this is where they

will be stored.
Class - this is a special form of code. (I don't

know enough about
this stuff and don't expect you to get

involved with these
anytime
soon - but some day!!!)
--
sb
wrote in message
...
general/standard module? what do you mean exactly? can
you provide me with a step-by-step?? thanks.....i'm

hope
i'm not asking for too much.

-----Original Message-----
Move the function to a general/standard module. Don't

put it in the code
module associated with any sheet. You should always

do
this.

--
Regards,
Tom Ogilvy

"Joshua" wrote in

message
...
hello all. i've recently built a function that is

used
to
manipulate a string (basically it pulls the last name

out
of a full name....minus any prefixes and suffixes,

etc).

the function works fine, and i'm pleased with it.
however, when i try to use the function in a new

excel
spreadsheet it isn't recognized. when i

place "getlastname
(a1)" in a cell, all i get is #NAME?.

any ideas as to how i might be able to access the

function?

thanks in advance!


.



.