ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get cell reference as parameter in function (https://www.excelbanter.com/excel-programming/406195-get-cell-reference-parameter-function.html)

RSunday

Get cell reference as parameter in function
 
I want to give a cell as a parameter to a function. In the function I want to
use the built-in functions ROW and COLUMN on the cell - i.e. I dont want the
value in the cell but the actual "cell reference".

How do I define my parameter for that use?

JLGWhiz

Get cell reference as parameter in function
 
..Address will give the cell reference.

"RSunday" wrote:

I want to give a cell as a parameter to a function. In the function I want to
use the built-in functions ROW and COLUMN on the cell - i.e. I dont want the
value in the cell but the actual "cell reference".

How do I define my parameter for that use?


Charles Williams

Get cell reference as parameter in function
 
Public function RSunday(theRange as range)

.... =theRange.row

etc

--
Charles
__________________________________________________
Outlines for my Sessions at the Australia Excel Users Group
http://www.decisionmodels.com/OZEUC.htm

"RSunday" wrote in message
...
I want to give a cell as a parameter to a function. In the function I want
to
use the built-in functions ROW and COLUMN on the cell - i.e. I dont want
the
value in the cell but the actual "cell reference".

How do I define my parameter for that use?




JLGWhiz

Get cell reference as parameter in function
 
You could probably get better suggestions if you post the code you are trying
to work with. To create a cell reference in the Cells(x, y) format requires
using an anchor reference that VBA already recognizes. Without seeing your
code, it is difficult to give you a viable solution short of a tutorial on
using variables to assign cell references.

"RSunday" wrote:

I want to give a cell as a parameter to a function. In the function I want to
use the built-in functions ROW and COLUMN on the cell - i.e. I dont want the
value in the cell but the actual "cell reference".

How do I define my parameter for that use?



All times are GMT +1. The time now is 10:48 AM.

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