Very Basic Newbie Question

  • Thread starter Thread starter Bruce A. Julseth
  • Start date Start date
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
 
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
 
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
 
Back
Top