Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / September 2007

Tip: Looking for answers? Try searching our database.

User defined functions aware of what cell they are placed in?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris - 18 Sep 2007 13:20 GMT
Hi,

I would like to make a user defined function which needs to know in
what cell and what worksheet it is placed in. I will be using this UDF
in multiple cells on multiple worksheets. I originally just passed the
cell row and column as parameters to the UDF however this ended up
updating all worksheets and not just the one the UDF was on.

Is there any way to do this?
Dave Peterson - 18 Sep 2007 13:35 GMT
Option Explicit
function myfunct(something as somethingelse) as something

  msgbox application.caller.address & vblf _
         & application.caller.parent.name  & vblf _
         & application.caller.parent.parent.name

End function

(application.caller is what you're looking for)

> Hi,
>
[quoted text clipped - 5 lines]
>
> Is there any way to do this?

Signature

Dave Peterson

Chris - 18 Sep 2007 14:26 GMT
Thanks!

Exactly what I've been looking for

> Option Explicit
> function myfunct(something as somethingelse) as something
[quoted text clipped - 20 lines]
>
> Dave Peterson
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.