User defined function to return cell address and cell value

Can someone help with this ?

I have a user defined function that uses the following fomula in a worksheet cell
=GetResult(CELL("address",E2))
both the cell address and cell value are used in further calcualtions within the function to Get the Result

can this be altered some how to
=GetResult(E2)
and still return the cell address and value
LVL 1
ReefITAsked:
Who is Participating?
 
zorvek (Kevin Jones)Connect With a Mentor ConsultantCommented:
To add to what Chris posted:

Public Function GetResult(Source As Range)
    MsgBox Source.Value
    MsgBox Source.Address
    GetResult = 123
End Function

Use like so:

   =GetResult(E2)

Kevin
0
 
Chris BottomleyConnect With a Mentor Software Quality Lead EngineerCommented:
This would be normal:> =GetResult(E2)

How is getresult defined ... use getResult(rng as range)

rng as a range can be used in the function to get contents and address.


Chris
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.