Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help with a UDF Function using Arrays...

Hello,

I am trying to write my first UDF... Basically, it takes the form of this
Formula:
{index($a$1:$g$100,match(c2,$b$1:$b$100,0),30)}

The arrays are normally on a different sheet within the workbook.

The function I created is as follows:
Function McreProfile(a As Range, b As Range, c As Range, d As Integer)
'This will return the Medicare Profile on the excel sheet...
McreProfile = Application.Evaluate("=Index(" & a.Address & ",match(" &
b.Address & "," & c.Address & ",0)," & d & ")")
End Function

On the worksheet I entered and I get a #N/A
=McreProfile('pprrvu03 MIA'!$A$1:$AJ$13391,Dade!I2,'pprrvu03
MIA'!$A$1:$A$13391,32)

Your help is greatly appreciated...
Thanks - Dennis G.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help with a UDF Function using Arrays...

you need to use address(0,0,xlA1,true)

since your ranges are on other sheets.

--
Regards,
Tom Ogilvy


"Dennis G." wrote in message
...
Hello,

I am trying to write my first UDF... Basically, it takes the form of

this
Formula:
{index($a$1:$g$100,match(c2,$b$1:$b$100,0),30)}

The arrays are normally on a different sheet within the workbook.

The function I created is as follows:
Function McreProfile(a As Range, b As Range, c As Range, d As Integer)
'This will return the Medicare Profile on the excel sheet...
McreProfile = Application.Evaluate("=Index(" & a.Address & ",match(" &
b.Address & "," & c.Address & ",0)," & d & ")")
End Function

On the worksheet I entered and I get a #N/A
=McreProfile('pprrvu03 MIA'!$A$1:$AJ$13391,Dade!I2,'pprrvu03
MIA'!$A$1:$A$13391,32)

Your help is greatly appreciated...
Thanks - Dennis G.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Help with a UDF Function using Arrays...

Thanks... This works like a charm.

"Tom Ogilvy" wrote:

you need to use address(0,0,xlA1,true)

since your ranges are on other sheets.

--
Regards,
Tom Ogilvy


"Dennis G." wrote in message
...
Hello,

I am trying to write my first UDF... Basically, it takes the form of

this
Formula:
{index($a$1:$g$100,match(c2,$b$1:$b$100,0),30)}

The arrays are normally on a different sheet within the workbook.

The function I created is as follows:
Function McreProfile(a As Range, b As Range, c As Range, d As Integer)
'This will return the Medicare Profile on the excel sheet...
McreProfile = Application.Evaluate("=Index(" & a.Address & ",match(" &
b.Address & "," & c.Address & ",0)," & d & ")")
End Function

On the worksheet I entered and I get a #N/A
=McreProfile('pprrvu03 MIA'!$A$1:$AJ$13391,Dade!I2,'pprrvu03
MIA'!$A$1:$A$13391,32)

Your help is greatly appreciated...
Thanks - Dennis G.




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
Combining arrays for a Lookup function Blue Max Excel Worksheet Functions 5 March 6th 09 11:53 PM
MATCH Function - 2 Dimension Arrays AZ_Ray Excel Worksheet Functions 3 September 11th 08 10:59 PM
Using arrays or range in IF function - HELP PLS MickJJ Excel Worksheet Functions 1 February 10th 06 05:43 PM
VBA: How to pass arrays in Function Calls? Mac Lingo[_2_] Excel Programming 4 November 1st 05 06:26 PM
Multiple arrays in Median function -- VBA Scott P Excel Programming 4 June 11th 04 06:47 AM


All times are GMT +1. The time now is 05:43 AM.

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"