View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default UDF - not always calculated

It's hard to say without seeing the code. Your problem was caused because it
was trying to refer to the range of the activesheet, so I forced it refer to
the range's parent sheet.

Post the whole code.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"makulski" wrote in message
...
I'm back. That worked for my addsome function. But when I tried to apply
it
to my real function, it didn't work and it occurs to me that I don't
understand the soln anyway.

I thought I'd just stick Application.Caller.Parent in front of every
range()
in my function. But that gives me an error 424 Object required.

application.caller seems to return a large integer (no idea what it is)
application.caller.parent (or dot any other property gets a 424).
It seems to work in the first worksheetfunction.(,range(),) though I don't
know why, but the next occurance in the UDF causes it to drop out of
runtime.

??
Next idea?


"Bob Phillips" wrote:

ToAdd = Application.WorksheetFunction.VLookup(AddWhat, _
Application.Caller.Parent.Range("TestRange"), 2, False)
addsome = InputValue + ToAdd