Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Address of cell invoking current UDF call?

I would like to write a user defined function that, as part of its
execution, needs to know the cell address from which it is currently called.
I.e. if
cell A1
= UDF(parm1, parm2)
then,
what type of statement can I use in the UDF to return the executing cell
address "A1"?

Assuming, of course, that such a thing is possible. Thanks in advance.
Larry.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Address of cell invoking current UDF call?

Try out this udf...
'--
Function Sludge()
Sludge = Application.Caller.Address
End Function
'--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Eddie"
wrote in message
I would like to write a user defined function that, as part of its
execution, needs to know the cell address from which it is currently called.
I.e. if
cell A1
= UDF(parm1, parm2)
then,
what type of statement can I use in the UDF to return the executing cell
address "A1"?

Assuming, of course, that such a thing is possible. Thanks in advance.
Larry.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Address of cell invoking current UDF call?

Here is one option...

Sub GetCurrentAddress()
Dim myCell As String
myCell = ActiveCell.Address
MsgBox myCell
End Sub


Mark Ivey

"Eddie" wrote in message
...
I would like to write a user defined function that, as part of its
execution, needs to know the cell address from which it is currently
called. I.e. if
cell A1
= UDF(parm1, parm2)
then,
what type of statement can I use in the UDF to return the executing
cell address "A1"?

Assuming, of course, that such a thing is possible. Thanks in advance.
Larry.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Address of cell invoking current UDF call?

Exactly what I need. And simple to boot. Thanks!!

"Jim Cone" wrote in message
...
Try out this udf...
'--
Function Sludge()
Sludge = Application.Caller.Address
End Function
'--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

"Eddie"
wrote in message
I would like to write a user defined function that, as part of its
execution, needs to know the cell address from which it is currently
called.
I.e. if
cell A1
= UDF(parm1, parm2)
then,
what type of statement can I use in the UDF to return the executing
cell
address "A1"?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Address of cell invoking current UDF call?

Thanks, Mark. This works for the active cell, but a cell calling a user
defined function may not necessarily be the active cell -- which Jim's
solution gets at. But I still appreciate the help.

Gotta love these help groups. Seldom fail to find people willing to help
out.

"Mark Ivey" wrote in message
...
Here is one option...

Sub GetCurrentAddress()
Dim myCell As String
myCell = ActiveCell.Address
MsgBox myCell
End Sub


Mark Ivey

"Eddie" wrote in message
...
I would like to write a user defined function that, as part of its
execution, needs to know the cell address from which it is currently
called. I.e. if
cell A1
= UDF(parm1, parm2)
then,
what type of statement can I use in the UDF to return the executing
cell address "A1"?

Assuming, of course, that such a thing is possible. Thanks in advance.
Larry.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum Column above current cell dynamically using function call TopSlice Excel Worksheet Functions 7 September 15th 09 02:03 PM
Get Address of Current Cell dhstein Excel Programming 7 November 22nd 08 05:58 PM
How do I call current computer time to a cell? Carol G. Excel Worksheet Functions 9 November 14th 08 04:37 AM
use current cell address as beginning of macro mohavv Excel Discussion (Misc queries) 2 April 18th 08 03:52 PM
Cell address of function call PatrickS Excel Programming 1 September 25th 07 10:48 AM


All times are GMT +1. The time now is 05:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"