How do I properly attach vba code to a workbook
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 "DrKilbert" wrote in message ... 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... |
Thanks again, Chip
"Chip Pearson" wrote: 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 "DrKilbert" wrote in message ... 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... |
All times are GMT +1. The time now is 04:31 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com