Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default getting the column address of an argument to a user defined functi

Hi I want to write a UDF in which I will need to access the column numbers of
function arguments from inside the body of the function. Example code is:

Function UserDefined(leftarg as double, rightarg as double) as double
n=worksheet columnnumber of leftarg
etc.
End function

Is there an easy way to access the column or worksheet address of a
function's arguments?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default getting the column address of an argument to a user defined functi

Function UserDefined(leftarg as range, rightarg as range) as double
n=leftarg.column
etc.
End function

--
Regards,
Tom Ogilvy


"Salman" wrote:

Hi I want to write a UDF in which I will need to access the column numbers of
function arguments from inside the body of the function. Example code is:

Function UserDefined(leftarg as double, rightarg as double) as double
n=worksheet columnnumber of leftarg
etc.
End function

Is there an easy way to access the column or worksheet address of a
function's arguments?

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default getting the column address of an argument to a user defined functi

You can't get the address of a "leftarg" because it declared as a Double and
as such does not have an address.
If you pass the range, then you can. e.g.
Function UserDefined(leftarg as Range, rightarg as Range) as double
Dim ColNum As Long
Dim WS As Worksheet

ColNum=leftarg.column
Set WS=leftarg.Parent
....etc

NickHK

"Salman" ...
Hi I want to write a UDF in which I will need to access the column numbers
of
function arguments from inside the body of the function. Example code is:

Function UserDefined(leftarg as double, rightarg as double) as double
n=worksheet columnnumber of leftarg
etc.
End function

Is there an easy way to access the column or worksheet address of a
function's arguments?

Thanks.



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
Problem with a converted office 2003 file with user defined functi ugoveri Excel Programming 0 July 2nd 06 08:16 PM
Programming help statements into my VBA custom user defined functi Craig Excel Programming 0 February 22nd 06 01:52 PM
Array as Argument in User-Defined Functions Tushar Mehta Excel Programming 0 May 19th 04 04:29 AM
Array as Argument in User-Defined Functions Harlan Grove[_5_] Excel Programming 0 May 18th 04 10:30 PM
Passing an Array of User-Defined Type to an Argument of a Function Tushar Mehta[_6_] Excel Programming 0 August 17th 03 06:43 PM


All times are GMT +1. The time now is 05:34 PM.

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"