Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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... |
#2
|
|||
|
|||
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... |
#3
|
|||
|
|||
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... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Make Change Case in Excel a format rather than formula | Excel Worksheet Functions | |||
Opening a file with code without a set file name | Excel Discussion (Misc queries) | |||
Unprotect Workbook | Excel Discussion (Misc queries) | |||
Often-Used Code not working in a new Workbook | Excel Discussion (Misc queries) | |||
Stubborn toolbars in Excel | Excel Discussion (Misc queries) |