Very Basic Newbie Question

B

Bruce A. Julseth

I started a new spreadsheet and went to the Visual Basic section. There I
write the following function:

Function NumTest()
NumTest = 5
End Function

Saved the sheet (ctr-S) and checked the Function Drop down list, selecting
"User Defined" and NumTest didn't appear.

Manually entered =NumTest in a cell and got the error, #NAME?

So what am I doing wrong.

Bruce
 
G

Gord Dibben

Bruce

Did you place the Function NumTest in a generql module?

If you placed it in a worksheet or Thisworkbook module it would not appear in
the User Defined list.

Also, the proper syntax would be =NumTest()

Gord Dibben Excel MVP
 
B

Bruce A. Julseth

Thanks for the help..

I did use =NumTest().

No, I put in a Thisworkbook module so that is the reason it won't work.

By "General Module", do you mean a plain VB module?

How do I this from within Excel? Can you refer me to tutorial that is online
which will help me?

Thanks again...

Bruce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top