Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I store my VBA UDF?

I'm an old-time programmer, but new to VBA in Excel 2007. I've written a
UDF, but so far, I haven't figured out how to test it in the Immediate window
(or the worksheet, for that matter). It compiles without error, but how do I
store it to make it accessible to the associated worksheet?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default How do I store my VBA UDF?

Just put it in a standard code module.

--
__________________________________
HTH

Bob

"cec34" wrote in message
...
I'm an old-time programmer, but new to VBA in Excel 2007. I've written a
UDF, but so far, I haven't figured out how to test it in the Immediate
window
(or the worksheet, for that matter). It compiles without error, but how
do I
store it to make it accessible to the associated worksheet?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default How do I store my VBA UDF?

Don't store it in a Worksheet Module, but in a General Module. So, from the
VBA menu: InsertModule and paste the code there.
Now you can call it from a worksheet as if it were a built-in Excel
function.
If you need to acces it from other workbooks or even distribute it: read
this:

http://www.jkp-ads.com/Articles/DistributeMacro00.asp

It says it is about macros, but most of it is true for functions as well

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"cec34" wrote in message
...
I'm an old-time programmer, but new to VBA in Excel 2007. I've written a
UDF, but so far, I haven't figured out how to test it in the Immediate
window
(or the worksheet, for that matter). It compiles without error, but how
do I
store it to make it accessible to the associated worksheet?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default How do I store my VBA UDF?

Put it in a standard module.

From the VBA window:

Insert Module

then paste the stuff in. Consider making the UDF Public.
--
Gary''s Student - gsnu200860


"cec34" wrote:

I'm an old-time programmer, but new to VBA in Excel 2007. I've written a
UDF, but so far, I haven't figured out how to test it in the Immediate window
(or the worksheet, for that matter). It compiles without error, but how do I
store it to make it accessible to the associated worksheet?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default How do I store my VBA UDF?

http://www.anthony-vba.kefra.com/vba/vbabasic1.htm
http://articles.techrepublic.com.com...1-5300300.html

HTH,
Ryan--
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Gary''s Student" wrote:

Put it in a standard module.

From the VBA window:

Insert Module

then paste the stuff in. Consider making the UDF Public.
--
Gary''s Student - gsnu200860


"cec34" wrote:

I'm an old-time programmer, but new to VBA in Excel 2007. I've written a
UDF, but so far, I haven't figured out how to test it in the Immediate window
(or the worksheet, for that matter). It compiles without error, but how do I
store it to make it accessible to the associated worksheet?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I store my VBA UDF?

Thanks! That's what I needed.

cec34

"Gary''s Student" wrote:

Put it in a standard module.

From the VBA window:

Insert Module

then paste the stuff in. Consider making the UDF Public.
--
Gary''s Student - gsnu200860


"cec34" wrote:

I'm an old-time programmer, but new to VBA in Excel 2007. I've written a
UDF, but so far, I haven't figured out how to test it in the Immediate window
(or the worksheet, for that matter). It compiles without error, but how do I
store it to make it accessible to the associated worksheet?


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
Store array ??? piero Excel Worksheet Functions 4 September 16th 09 04:39 PM
store variables Patrick C. Simonds Excel Programming 4 February 23rd 08 09:17 PM
How can I store both key and value in VBA? Dev Excel Programming 1 January 25th 07 10:29 PM
store inventory sheet(ex:sports equipment store) vardan Excel Worksheet Functions 1 October 11th 06 12:51 AM
Where to store macros? chin_un_len Excel Discussion (Misc queries) 3 February 11th 06 11:10 PM


All times are GMT +1. The time now is 05:47 PM.

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

About Us

"It's about Microsoft Excel"