Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call a function from a cell in Excel? 1

Status
Not open for further replies.

GrodanBoll

Programmer
Mar 6, 2002
45
ZA
Hi

I have treid to search the forum and the faq but I can't find the answer.

I have created ia function in VBA in 'ThisWorkbook'.
Now I'd like to call the function from a cell in my worksheet. I have tried to use '=test01(Typ)' like if i'd call a predifined function but it does not work, I get 'Invalid Name Error'.

How do I call the function?

Thanks
Grodan
 
You have to create your function in a standard code module, not the ThisWorkbook one.
In the context menu (right click) of ThisWorkbook choose Insert -> Module

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks alot PHV, U saved my day.
Sometimes it's hard to start something new and then it's very helpful to get a push in the right direction.

Thanks again.

Hope U have a nice weekend! :)

/Grodan
 
If you want to use it in another workbook you have either do copy the module in every workbook where you want to use it or to save it in an .xla module and load in at the starup of Excel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top