Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default is it possible to pass a reference to a function as an argument

I'd like to write a vba function, referencable by an argument of a vba
subroutine.
I think, the answer is NO, but i'd like to be sure about it.
I may avoid it, but it would be nice.

Thanks, ahead:-)

SlowArrow
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default is it possible to pass a reference to a function as an argument

Huh ?
Helpful posting advice here... http://www.cpearson.com/excel/newposte.htm
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"SlowArrow"
wrote in message
I'd like to write a vba function, referencable by an argument of a vba
subroutine.
I think, the answer is NO, but i'd like to be sure about it.
I may avoid it, but it would be nice.

Thanks, ahead:-)

SlowArrow
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default is it possible to pass a reference to a function as an argument

I am a little unclear what exactly you want to do. Do you want to pass a
subroutine as an argument to a function (this would be similar to the ability
in C to pass a function as an argument). If that is what you are looking to
do then the answer is no. Perhaps a better explanation of what you would like
to accomplish will allow us to provide you with a satisfactory answer
though...
--
HTH...

Jim Thomlinson


"SlowArrow" wrote:

I'd like to write a vba function, referencable by an argument of a vba
subroutine.
I think, the answer is NO, but i'd like to be sure about it.
I may avoid it, but it would be nice.

Thanks, ahead:-)

SlowArrow

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default is it possible to pass a reference to a function as an argumen

Dear Jim,

I appreciate your effort to help me. What I was looking for, is really the
c-like calling of the subroutines:-( Such is the life;-) I've seen some signs
(but not direct statements) in the vba help, and I saw some samples on the
internet to handle vba-written callback functions (here there were also
notices, which told me a strong no). However, people always hope some more
beautiful;-)

The problem, what indicated my question is the following, shortly:
I have just written a pretty userform with the mscal.ocx to to fill a
combobox (or textbox, but this is not important) called from the control's
MouseDown event. It works, but sometimes it is not enough to fill the box
with the selected date: I have to transform it a bit somehow (for example,
instead of writing the selected date, we have to put the first day of the
week containing the selected date into the control). Instead of wiring in the
code of the Calendar userform (at least a parameterizable code), I thought a
function passing feature would be the most general and elegant. So, this is
why i wanted to be sure about it.

Thanks for your help, again:-)

SlowArrow

"Jim Thomlinson" wrote:

I am a little unclear what exactly you want to do. Do you want to pass a
subroutine as an argument to a function (this would be similar to the ability
in C to pass a function as an argument). If that is what you are looking to
do then the answer is no. Perhaps a better explanation of what you would like
to accomplish will allow us to provide you with a satisfactory answer
though...
--
HTH...

Jim Thomlinson


"SlowArrow" wrote:

I'd like to write a vba function, referencable by an argument of a vba
subroutine.
I think, the answer is NO, but i'd like to be sure about it.
I may avoid it, but it would be nice.

Thanks, ahead:-)

SlowArrow

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 pass cell reference to VBA function? [email protected] Excel Programming 3 March 9th 07 03:28 PM
How to pass cell reference to VBA function? [email protected] Excel Programming 6 April 7th 06 12:48 AM
Pass function as argument to UDF Ron Rosenfeld Excel Programming 10 February 9th 06 12:48 PM
Pass Argument? Hal[_4_] Excel Programming 1 December 5th 05 05:19 PM
Function (array argument, range argument, string argument) vba Witek[_2_] Excel Programming 3 April 24th 05 03:12 PM


All times are GMT +1. The time now is 01:44 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"