How do I evalute myudf as excel evaulates its own in-built functions? many experts has said it is imposible , VBA doesnt have native ability to this, and to basically "Go and learn Python or C" instead. And there are many ways to do this.
But I think VBA can do this, becuause some UDF's evaluate just like excels inbuilt fucntions so, so why cant mine?
=myudf(parm1,parm2)
when PARM1 = C1 or any other cell , it works.
Parm1 = "C1"&"Goodbye" - I get #errors and #na's or #cant excecute functions
MYUDF(c1,parm2)&"Goodbye" it works (although thats not what i want to do. If it was I wouldnt be asking the question.
MYUDF(vlookup(a1,a1:z1,3,0),parm2) - I get #errors and #na's or #cant execute function
im using
myudf(anything at all bar once an indirect to refernce a cell,parm2) - I get #errors and #na's or #cant execute function
As i said, an expert on another forum (which I have in my history but cant dig up to give you the link right now) was arguing and upset with VBA as a whole that VBA did not have the native ability to handle arguments in arguments in arguments (and so on) in a UDF.
Am I right? or if anyone does know of a subroutine to tell excel to read the argument in the funtion first before performing the UDF, Id love to know. Im sure there is, and it would be said if it didnt.
p.s. Arguments or parameters or whatver you call them. Ive been calling them arguments,
[needs an edit and to add to]
But I think VBA can do this, becuause some UDF's evaluate just like excels inbuilt fucntions so, so why cant mine?
=myudf(parm1,parm2)
when PARM1 = C1 or any other cell , it works.
Parm1 = "C1"&"Goodbye" - I get #errors and #na's or #cant excecute functions
MYUDF(c1,parm2)&"Goodbye" it works (although thats not what i want to do. If it was I wouldnt be asking the question.
MYUDF(vlookup(a1,a1:z1,3,0),parm2) - I get #errors and #na's or #cant execute function
im using
Code:
Evaluate "mysubinmyudf(" & Evaluate(parm1.value(0, 0))
myudf(anything at all bar once an indirect to refernce a cell,parm2) - I get #errors and #na's or #cant execute function
As i said, an expert on another forum (which I have in my history but cant dig up to give you the link right now) was arguing and upset with VBA as a whole that VBA did not have the native ability to handle arguments in arguments in arguments (and so on) in a UDF.
Am I right? or if anyone does know of a subroutine to tell excel to read the argument in the funtion first before performing the UDF, Id love to know. Im sure there is, and it would be said if it didnt.
p.s. Arguments or parameters or whatver you call them. Ive been calling them arguments,
[needs an edit and to add to]