View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Test if Function is Run from worksheet or from VBA

One mo

if typename(application.caller) = "Range" then
'called from a cell
else
'not called from a cell
end if

(Case is important in "Range".)




Andibevan wrote:

Is there any way I can test whether a function has been called because it is
used in a cell, or whether it is called from code?


--

Dave Peterson