Archive of Mr Excel Message Board


Back to Forms in Excel VBA archive index
Back to archive home

3 Lowest Values Function Help Needed

Posted by Steve Bell on November 05, 2001 5:20 AM
I'm writing a function to return an array of the 3 lowest values passed to it. I wanted to pass an array as an argument to it. I can't seem to figure out how to pass arrays as arguments to a VBA function. Any ideas?

Check out our Excel Resources

Re: 3 Lowest Values Function Help Needed

Posted by Mark O'Brien on November 05, 2001 6:15 AM

You need to pass arrays to functions, subs etc using "ByRef".
e.g.

Public Sub GetArray(ByRef Myarray() As String)


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.