Quick dumb question

oric

New Member
Joined
Jul 19, 2005
Messages
36
I have been trying to find the answer to this in my dummies book but have not had too much success.

I'm writing a custom function in VBA. I want to use it in other Sub that is not in the same module where I wrote the function. When I tried to do this it gave me an error (I used the immediate window to check if it will work). I had to always click in the module where the function was in order to get it to work.

Is there a place I can put the function so that it will be recognized by all modules?

thx
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Purple Youko

Active Member
Joined
Sep 17, 2004
Messages
265
How did you define the function?

If you start with "Public Function" rather than "Private Function" then you should be able to access it from other modules.
 

oric

New Member
Joined
Jul 19, 2005
Messages
36
I just called it

Function ()

End Function


I'll go ahead and try adding Public. I knew it was something easy.

thanks.
 

Watch MrExcel Video

Forum statistics

Threads
1,119,002
Messages
5,575,482
Members
412,668
Latest member
Lukep22
Top