View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
TomCee TomCee is offline
external usenet poster
 
Posts: 32
Default Where should the code be stored? (Excel97)

Pardon the rather 'green' user here...I am trying to understand how
Excel finds user written VBA code.

I am defining functions in Excel 97.

When I open the VBE and write code, it is automatically stored in the
'Sheet1' object. When I reference the defined function (on Sheet1), I
get a #NAME? error in the cells. It appears that the code is not
found.

When I copy the code in the 'Module1' object, the code works.

Why doesn't Excel find this code in the Sheet1? Should I store all
code in the Module1 object? Why didn't Excel do this automatically for
me?

thanks for your patience and assistance,
TomCee