PC Review


Reply
 
 
Mark Kubicki
Guest
Posts: n/a
 
      16th Jun 2009
is there a function that identifies what cell a formula is being used in?

ex; I have a formula: =LMI(xx) entered into cell B32 as part of the code
behind the formula, I need to know what cell the formula is being used in.

many thanks in advance,
mark


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      16th Jun 2009
Do you mean within the code for the LMI user defined function?

If yes, you can use application.caller

Option Explicit
Function LMI(xxx as yyyy) as uuuu
debug.print application.caller
...
end function

Mark Kubicki wrote:
>
> is there a function that identifies what cell a formula is being used in?
>
> ex; I have a formula: =LMI(xx) entered into cell B32 as part of the code
> behind the formula, I need to know what cell the formula is being used in.
>
> many thanks in advance,
> mark


--

Dave Peterson
 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      16th Jun 2009
I'm assuming LMI is a UDF that you wrote and it is its code that you want to
have know which cell called it. You would use Application.Caller to return a
range object which references that cell.

--
Rick (MVP - Excel)


"Mark Kubicki" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> is there a function that identifies what cell a formula is being used in?
>
> ex; I have a formula: =LMI(xx) entered into cell B32 as part of the code
> behind the formula, I need to know what cell the formula is being used in.
>
> many thanks in advance,
> mark
>


 
Reply With Quote
 
Tim Zych
Guest
Posts: n/a
 
      16th Jun 2009
Here's a sample UDF using the Caller property:

' UDF which returns the address info of the cell
' in which it resides
Function Addr() As String
' Addr = Application.Caller.Address
' Or more detail
With Application.Caller
Addr = .Parent.Parent.Name & ", " & _
.Parent.Name & ", " & .Address(0, 0)
End With
End Function


--
Regards,
Tim Zych
http://www.higherdata.com
Workbook Compare - Excel data comparison utility

"Mark Kubicki" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> is there a function that identifies what cell a formula is being used in?
>
> ex; I have a formula: =LMI(xx) entered into cell B32 as part of the code
> behind the formula, I need to know what cell the formula is being used in.
>
> many thanks in advance,
> mark
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:46 AM.