Interpretation of a piece of code

  • Thread starter Thread starter FARAZ QURESHI
  • Start date Start date
F

FARAZ QURESHI

Can any friend explain to me what is the following part of code means:
Application.Caller.Parent.Evaluate
 
I bet that this was used in a UDF.

If I'm right...
Application.caller would be the cell that held the UDF.
application.caller.parent would be the worksheet that held that cell.

application.caller.parent.evaluate means to use that worksheet for any
unqualified ranges in the string that is being evaluated.

msgbox worksheets("sheet1").evaluate("a1+b1")
and
msgbox worksheets("sheet2").evaluate("a1+b1")

would use A1 and B1 from Sheet1 and Sheet2 (respectively)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top