Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
DrKilbert
 
Posts: n/a
Default 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   Report Post  
Chip Pearson
 
Posts: n/a
Default

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   Report Post  
DrKilbert
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM
Opening a file with code without a set file name jenkinspat Excel Discussion (Misc queries) 1 March 4th 05 10:50 AM
Unprotect Workbook Kent Excel Discussion (Misc queries) 1 February 4th 05 01:07 AM
Often-Used Code not working in a new Workbook Steve Excel Discussion (Misc queries) 2 December 16th 04 11:55 PM
Stubborn toolbars in Excel 007 Excel Discussion (Misc queries) 9 December 11th 04 02:02 PM


All times are GMT +1. The time now is 03:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"