How do I properly attach vba code to a workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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...
 
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]...
 
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
 
Back
Top