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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Okay, idiotic question: how to call a user-defined function

Status
Not open for further replies.

ame12

Vendor
Jan 23, 2001
24
0
0
US
I've defined a simple function in the VB editor:

Function Test412() As Integer
Test412 = 412
End Function

When I try to call it in a cell as =Test412 or =Test412() or =Sheet1.Test412() or any other variant I can think of, I get "undefined function". I've tried defining the function at the sheet level, the workbook level, etc.

I must be an idiot, but can't get this simple call-out to work! Any help would be appreciated.
 
ame12,

No you're not an idiot; you just seem to have an aversion to using the standard Code Module. In the VB editor, choose Insert -> Module from the menubar. Procedures and functions entered here are public by default. You will be able to use =Test412() in any worksheet cell.

BTW, I have replied to your post regarding tracking the modified date of a worksheet.

HTH
M. Smith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top