Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try commenting out the function and see if you get a code error or bad
references. 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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like this perhaps
Function myFunc() Dim x On Error Resume Next x = Application.Caller.Address If Err.Number = 0 Then MsgBox "Called from Worksheet" Else MsgBox "Called from VBA" End If On Error GoTo 0 End Function -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Andibevan" wrote in message ... 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? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for all the suggestions
|
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Check out Application.Caller
NickHK "Andibevan" .gbl... 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? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Test cell interior color by worksheet function? | Excel Worksheet Functions | |||
Getting corresponding test value to a MIN function | Excel Worksheet Functions | |||
Getting corresponding test value to a MIN function | Excel Programming | |||
Test worksheet name | Excel Programming | |||
Test for Worksheet | Excel Programming |