Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to get the row that a user-defined function is on?
ActiveCell.Row seems work, until you drag down to fill the function at which time each funcion will return only the first cell (the activecell). I think I need this in order to reference other cells in the same row that the function is in. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Usenethelp,
Try: Application.Caller.Row --- Regards, Norman "usenethelp" wrote in message om... Is it possible to get the row that a user-defined function is on? ActiveCell.Row seems work, until you drag down to fill the function at which time each funcion will return only the first cell (the activecell). I think I need this in order to reference other cells in the same row that the function is in. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use Net Help,
In your function, use: Dim myRow As Long Dim myVal As Variant myRow = Application.Caller.Row 'To get data from column A myVal = Application.Caller.Parent.Cells(myRow, 1).Value HTH, Bernie MS Excel MVP "usenethelp" wrote in message om... Is it possible to get the row that a user-defined function is on? ActiveCell.Row seems work, until you drag down to fill the function at which time each funcion will return only the first cell (the activecell). I think I need this in order to reference other cells in the same row that the function is in. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
set rng = Application.Caller
will give a range reference to the cell containing the UDF rng.row would give you the row. -- Regards, Tom Ogilvy "usenethelp" wrote in message om... Is it possible to get the row that a user-defined function is on? ActiveCell.Row seems work, until you drag down to fill the function at which time each funcion will return only the first cell (the activecell). I think I need this in order to reference other cells in the same row that the function is in. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dont forget that if your UDF references other cells like this
I think I need this in order to reference other cells in the same row that the function is in. that you will need to make it volatile ... Application.volatile true Charles ______________________ Decision Models The Excel Calculation Site. www.DecisionModels.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks guys!!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
user defined function | Excel Worksheet Functions | |||
User-defined data type; Error: Only User-defined types... | Excel Programming | |||
current cell in user-defined function | Excel Programming | |||
Help within user defined function | Excel Programming | |||
User-Defined Function pre-empting Built-in Function? How to undo???? | Excel Programming |