LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default Passed Arguments to a UDF

I have a problem passing arguments to a UDF. I believe it is a specific
problem since I've passed a lot of arguments to a lot of other UDF's in the
past. I'm working with Excel 2003 on Vista.

The Workbook looks like:

... F G
R S
14 [F14] [G14 <Range
R14] [S14]

F14 has a formula that produces an Integer as a function of what's in the
Range.
G14:R14 is mostly integers, but with a few alphas and nulls.
S14 has a formula containing the UDF Action(F14, G14:R14).

The UDF takes the form:

Function Action(X As Integer, Rrrr As Range) As Integer
...
Stuff
...
End Function

My problem is the only value I can get out of X is 0 (zero), regardless of
what's in F14.
I've tried ByVal X and the default, ByRef X. Still 0.
I've tried putting an Integer in B3 and passing B3 instead of F14. Still 0.
Since I'm able to pick every cell out of Range Rrrr in the UDF, I've tried
extending Rrrr to F14:R14 (changed
the passed arguments accordingly). Regardless of what's in the first
cell of the Rrrr, all I can still get is a 0.

If I change the Call to Action(3, G14:R14), the 3 comes through for the
value of X.

Any ideas, suggestions?

Respectfully submitted,
Bob Myers


 
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
Mark date that has passed Michaela Excel Worksheet Functions 5 September 22nd 08 02:31 PM
how do I fix a forecast date that has passed for a zero value? chicken Excel Discussion (Misc queries) 0 November 29th 06 06:05 AM
IF Formula to calculate whether date has passed Janelle Lister Excel Discussion (Misc queries) 4 October 19th 06 03:32 PM
Date Passed Notification Lori Excel Discussion (Misc queries) 3 April 12th 06 05:46 PM
how do i work out how many hrs have passed in a 24 hr clock, in ex excelious Excel Worksheet Functions 2 March 10th 05 11:51 AM


All times are GMT +1. The time now is 12:45 AM.

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"