ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   UDF: Celll Row Number (https://www.excelbanter.com/excel-discussion-misc-queries/225032-udf-celll-row-number.html)

Arun

UDF: Celll Row Number
 
I'm writing a UDF function that requires the row number of the cell it's in.
How do I write a simple UDF that returns the row in which the function is
called from?

For example, the function RowFind below will return the value the CURSOR is
in.

Function RowFind
RowFind = ActiveCell.Row
End Function

Is there a an alternative to ActiveCell that will give the cell the FUNCTION
is in?

Thanks!

Bob Phillips[_3_]

Celll Row Number
 
Function RowFind()
RowFind = Application.Caller.Row
End Function



--
__________________________________
HTH

Bob

"Arun" wrote in message
...
I'm writing a UDF function that requires the row number of the cell it's
in.
How do I write a simple UDF that returns the row in which the function is
called from?

For example, the function RowFind below will return the value the CURSOR
is
in.

Function RowFind
RowFind = ActiveCell.Row
End Function

Is there a an alternative to ActiveCell that will give the cell the
FUNCTION
is in?

Thanks!





All times are GMT +1. The time now is 11:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com