Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Can I use a VBA function I write myself in a formula?

Can I use a VBA function I write myself in a formula? It appears to be
impossibe...



Thanks

David Laub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Can I use a VBA function I write myself in a formula?

Hi
use a macro like

public function my_function()
my_function=1234
end function

and in a cell type:
=MY_FUNCTION()

See: http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Can I use a VBA function I write myself in a formula? It appears to

be
impossibe...



Thanks

David Laub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Can I use a VBA function I write myself in a formula?

When I try this, I get a "Invalid Name' error in Excel - i can use built in
function and named cells fine

Is there some sort of subtle scoping/fully qualified name" issue


"Frank Kabel" wrote in message
...
Hi
use a macro like

public function my_function()
my_function=1234
end function

and in a cell type:
=MY_FUNCTION()

See: http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Can I use a VBA function I write myself in a formula? It appears to

be
impossibe...



Thanks

David Laub





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Can I use a VBA function I write myself in a formula?

Hi
where did you put this code?. It has to go in a standard module (see
the link I provided to you)

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
When I try this, I get a "Invalid Name' error in Excel - i can use

built in
function and named cells fine

Is there some sort of subtle scoping/fully qualified name" issue


"Frank Kabel" wrote in message
...
Hi
use a macro like

public function my_function()
my_function=1234
end function

and in a cell type:
=MY_FUNCTION()

See: http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Can I use a VBA function I write myself in a formula? It appears

to
be
impossibe...



Thanks

David Laub






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Can I use a VBA function I write myself in a formula?

Thanks again - I originally placed it in Sheet1 object instead of a New
Module

P.S. I read your note for listing User Defined Functions, but I don't know
how to "see" the Function Wizard list - can you help me even more?

Thanks
"Frank Kabel" wrote in message
...
Hi
where did you put this code?. It has to go in a standard module (see
the link I provided to you)

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
When I try this, I get a "Invalid Name' error in Excel - i can use

built in
function and named cells fine

Is there some sort of subtle scoping/fully qualified name" issue


"Frank Kabel" wrote in message
...
Hi
use a macro like

public function my_function()
my_function=1234
end function

and in a cell type:
=MY_FUNCTION()

See: http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Can I use a VBA function I write myself in a formula? It appears

to
be
impossibe...



Thanks

David Laub










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Can I use a VBA function I write myself in a formula?

Here's a bonus question: Thanks to your tip, I can invoke a User Defined
Function to populate a cell!
What I'd really love to do additionally is invoke a User Defined function as
part of formula based custom Data Validation - when I try this on a UDF that
works great as a formula cell value, I get a "can't find named range"
error - i.e. the Data Validation dialog is not understanding that the name
of my function is a user defined function - I can enter built-in function
names, or named cells, but (so far) I can't enter a user defined function

Thanks again

"Frank Kabel" wrote in message
...
Hi
where did you put this code?. It has to go in a standard module (see
the link I provided to you)

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
When I try this, I get a "Invalid Name' error in Excel - i can use

built in
function and named cells fine

Is there some sort of subtle scoping/fully qualified name" issue


"Frank Kabel" wrote in message
...
Hi
use a macro like

public function my_function()
my_function=1234
end function

and in a cell type:
=MY_FUNCTION()

See: http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Can I use a VBA function I write myself in a formula? It appears

to
be
impossibe...



Thanks

David Laub








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Can I use a VBA function I write myself in a formula?

Hi
AFAIK you can't use UDFs within Data Validation. Just an Excel
restriction!

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Here's a bonus question: Thanks to your tip, I can invoke a User

Defined
Function to populate a cell!
What I'd really love to do additionally is invoke a User Defined

function as
part of formula based custom Data Validation - when I try this on a

UDF that
works great as a formula cell value, I get a "can't find named range"
error - i.e. the Data Validation dialog is not understanding that the

name
of my function is a user defined function - I can enter built-in

function
names, or named cells, but (so far) I can't enter a user defined

function

Thanks again

"Frank Kabel" wrote in message
...
Hi
where did you put this code?. It has to go in a standard module

(see
the link I provided to you)

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
When I try this, I get a "Invalid Name' error in Excel - i can

use
built in
function and named cells fine

Is there some sort of subtle scoping/fully qualified name" issue


"Frank Kabel" wrote in message
...
Hi
use a macro like

public function my_function()
my_function=1234
end function

and in a cell type:
=MY_FUNCTION()

See: http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Can I use a VBA function I write myself in a formula? It

appears
to
be
impossibe...



Thanks

David Laub









  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Can I use a VBA function I write myself in a formula?

Thanks - I'll stop spinning my wheels on that one!!!
"Frank Kabel" wrote in message
...
Hi
AFAIK you can't use UDFs within Data Validation. Just an Excel
restriction!

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Here's a bonus question: Thanks to your tip, I can invoke a User

Defined
Function to populate a cell!
What I'd really love to do additionally is invoke a User Defined

function as
part of formula based custom Data Validation - when I try this on a

UDF that
works great as a formula cell value, I get a "can't find named range"
error - i.e. the Data Validation dialog is not understanding that the

name
of my function is a user defined function - I can enter built-in

function
names, or named cells, but (so far) I can't enter a user defined

function

Thanks again

"Frank Kabel" wrote in message
...
Hi
where did you put this code?. It has to go in a standard module

(see
the link I provided to you)

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
When I try this, I get a "Invalid Name' error in Excel - i can

use
built in
function and named cells fine

Is there some sort of subtle scoping/fully qualified name" issue


"Frank Kabel" wrote in message
...
Hi
use a macro like

public function my_function()
my_function=1234
end function

and in a cell type:
=MY_FUNCTION()

See: http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Can I use a VBA function I write myself in a formula? It

appears
to
be
impossibe...



Thanks

David Laub











  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Can I use a VBA function I write myself in a formula?


Hi Frank,

I believe, however, that you can use a data validation formula that refers
to a cell that uses the UDF.


---
Regards,
Norman


"Frank Kabel" wrote in message
...
Hi
AFAIK you can't use UDFs within Data Validation. Just an Excel
restriction!

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Here's a bonus question: Thanks to your tip, I can invoke a User

Defined
Function to populate a cell!
What I'd really love to do additionally is invoke a User Defined

function as
part of formula based custom Data Validation - when I try this on a

UDF that
works great as a formula cell value, I get a "can't find named range"
error - i.e. the Data Validation dialog is not understanding that the

name
of my function is a user defined function - I can enter built-in

function
names, or named cells, but (so far) I can't enter a user defined

function

Thanks again

"Frank Kabel" wrote in message
...
Hi
where did you put this code?. It has to go in a standard module

(see
the link I provided to you)

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
When I try this, I get a "Invalid Name' error in Excel - i can

use
built in
function and named cells fine

Is there some sort of subtle scoping/fully qualified name" issue


"Frank Kabel" wrote in message
...
Hi
use a macro like

public function my_function()
my_function=1234
end function

and in a cell type:
=MY_FUNCTION()

See: http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Can I use a VBA function I write myself in a formula? It

appears
to
be
impossibe...



Thanks

David Laub











  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Can I use a VBA function I write myself in a formula?

Hi Norman
correct. This would be a workaround - just forgot it :-)

--
Regards
Frank Kabel
Frankfurt, Germany

"Norman Jones" schrieb im Newsbeitrag
...

Hi Frank,

I believe, however, that you can use a data validation formula that

refers
to a cell that uses the UDF.


---
Regards,
Norman


"Frank Kabel" wrote in message
...
Hi
AFAIK you can't use UDFs within Data Validation. Just an Excel
restriction!

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Here's a bonus question: Thanks to your tip, I can invoke a User

Defined
Function to populate a cell!
What I'd really love to do additionally is invoke a User Defined

function as
part of formula based custom Data Validation - when I try this on

a
UDF that
works great as a formula cell value, I get a "can't find named

range"
error - i.e. the Data Validation dialog is not understanding that

the
name
of my function is a user defined function - I can enter built-in

function
names, or named cells, but (so far) I can't enter a user defined

function

Thanks again

"Frank Kabel" wrote in message
...
Hi
where did you put this code?. It has to go in a standard module

(see
the link I provided to you)

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
When I try this, I get a "Invalid Name' error in Excel - i

can
use
built in
function and named cells fine

Is there some sort of subtle scoping/fully qualified name"

issue


"Frank Kabel" wrote in message
...
Hi
use a macro like

public function my_function()
my_function=1234
end function

and in a cell type:
=MY_FUNCTION()

See: http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"David Laub" schrieb im Newsbeitrag
...
Can I use a VBA function I write myself in a formula? It

appears
to
be
impossibe...



Thanks

David Laub












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
How to write a function formula Raymond L Excel Discussion (Misc queries) 1 April 27th 08 10:59 AM
how do you write format results of a function within a function? sangee Excel Worksheet Functions 3 June 14th 07 12:45 AM
i need to write an IF function formula, how? maxwell New Users to Excel 1 June 6th 06 05:42 PM
How do I write a IF function formula? JulieA60 New Users to Excel 4 April 11th 06 11:11 PM
how do I write a vlookup function within an iserror function so t. JBLeeds Excel Worksheet Functions 2 March 16th 05 10:30 AM


All times are GMT +1. The time now is 09:29 PM.

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"