ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I store my VBA UDF? (https://www.excelbanter.com/excel-programming/432283-how-do-i-store-my-vba-udf.html)

cec34

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?



Bob Phillips[_3_]

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?





Niek Otten

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?




Gary''s Student

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?



ryguy7272

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?



cec34

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?




All times are GMT +1. The time now is 02:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com