Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VB worksheet function parms

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VB worksheet function parms

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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VB worksheet function parms

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

"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?




  #4   Report Post  
Posted to microsoft.public.excel.programming
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?

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
Reference the worksheet from a multiple worksheet range function ( DBickel Excel Worksheet Functions 1 May 28th 05 03:49 AM
Can the offset worksheet function reference another worksheet AlistairJ Excel Worksheet Functions 2 May 9th 05 06:18 PM
Excel Start-up parms MrT Excel Programming 3 February 7th 05 12:36 PM
formula/function to copy from worksheet to worksheet Jen Excel Programming 5 January 11th 05 08:22 PM
Can't see macros with parms in Tools -- Macros Peter Chatterton Excel Programming 3 September 7th 04 03:05 PM


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