How do I properly attach vba code to a workbook

D

DrKilbert

I have a function and entered it into the vba editor, syntax and all is
clean, but my spreadsheet won't recognize the new command when I go to use
it. displays #name? etc. etc. This is my first time to actually use the vba
editor, so obviously I'm missing some basics somewhere...

T-I-A...
 
C

Chip Pearson

Where did you put the code? It should be in a regular code
module, NOT a sheet's code module or the ThisWorkbook code
module. In the VBA Editor, go to the Insert menu and choose
Module. Put the code in that module.

Also, if you are attempting to call the function from another
workbook, you need to put the workbook name in the call to the
function.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



message
news:D[email protected]...
 
D

DrKilbert

Thanks again, Chip

Chip Pearson said:
Where did you put the code? It should be in a regular code
module, NOT a sheet's code module or the ThisWorkbook code
module. In the VBA Editor, go to the Insert menu and choose
Module. Put the code in that module.

Also, if you are attempting to call the function from another
workbook, you need to put the workbook name in the call to the
function.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



message
 

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