View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Really Easy But having a mental Blank

I am not absolutely sure what you want Andi, but a UDF would simply be

Function myAddress()
myAddress = Application.Caller.Address(False, False)
End Function

but this will only work as a worksheet function, so I can't quite see it's
value.

From within a function, you can get a cell's row and/or column number with

rng.Row (.Column)

where rng is any range object, such as Selection, Activecell, or
Range("A1").

Perhaps if you give a bit more detail I can be more helpful.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Have just had a closer look and I am off the mark for what I want to do.

Is it possible for a UDF to return the address or column of the cell which
it is in. This isn't actually what I need to do but I can manage all the
other parts.

Essentially I have a huge SUMPRODUCT formula which uses multiple If
statement and I would find it much easier to put all the coding in a UDF.
If the UDF new which cell it was running in, I would not have any need for
any locations for variables to be included.

Thanks

Andi

"Andibevan" wrote in message
...
Thanks Bob - I was just about to ask exactly that as my app needs non-an
absolute reference

"Bob Phillips" wrote in message
...
or MsgBox Activecell.Address(False,False) to get A1 style.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mangesh Yadav" wrote in message
...
MsgBox ActiveCell.Address

Mangesh



"Andibevan" wrote in message
...
How do you return the range of the active cell in a messagebox?

(i.e.
if
A1
is selected it returns A1)