Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to use the address of a cell where I enter a UDF in
the UDF itself. How can I do that? So the UDF code would say something like: take column number of cell where function is entered return the number of columns between function and column D Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Salman,
Application.Caller will return a Range reference to the cell which called the function. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Salman" wrote in message ... I need to use the address of a cell where I enter a UDF in the UDF itself. How can I do that? So the UDF code would say something like: take column number of cell where function is entered return the number of columns between function and column D Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Salman,
A user defined function does not know the address where you enter the function, you would have to include that as a parameter. You can use a function in another macro that has absolution no connection with any cell address. i.e. convert_to_cubic_yards(500) Can you use a worksheet function H44: =COLUMN(H44) - COLUMN(D1) --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "Salman" wrote in message ... I need to use the address of a cell where I enter a UDF in the UDF itself. How can I do that? So the UDF code would say something like: take column number of cell where function is entered return the number of columns between function and column D Thanks. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
in a UDF
Dim rng as Range set rng = Applition.Caller will set rng to the cell containing the UDF -- Regards, Tom Ogilvy "Salman" wrote in message ... I need to use the address of a cell where I enter a UDF in the UDF itself. How can I do that? So the UDF code would say something like: take column number of cell where function is entered return the number of columns between function and column D Thanks. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
application.caller it is, now I've got to do 5 good replies to
make up for my mistake. David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|