View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default VB worksheet function parms

Hi Mark,

Mark H wrote:
And if the parameters are range objects, i.e. cell addresses, then
what? can I say parm.col or something?


If you pass in Range objects, then you can get the column & row like this:

Public Function TESTFUNCTION(range1 As Range, _
range2 As Range) As Variant
TESTFUNCTION = "(" & range1.Row & "," & range2.Column & _
"),(" & range2.Row & "," & range2.Column & ")"
End Function

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


"Chip Pearson" wrote:

Unless your function parameters are Range objects, there is no
way to determine where the values came from.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Mark H" wrote in message
...
I've written a worksheet function in VB that is used by
entering it in a cell
in the worksheet with two parameters. I'd like to find a way
to know what
row or column the passed parameters came from so that I can
conditionally
determine the function output based on that row or column. Is
there an
object, method or property that will tell me this info about
passed
parameters to a VB function?