Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to call the EXACT formula from VBA

I am trying to call Application.WorksheetFunction.Exact. I did do a search trying to find the solution to (so far) no avail.
Here is what I have attempted:

Set deltaCell = ActiveWorkbook.Sheets("qry_invalid_deltas").Range("z4")
Set outCell = deltaCell.Offset(0, -1)
Set inCell = outCell.Offset(0, -1)
debug.print(CDbl(deltaCell.Value) <> CDbl(outCell.Value) - CDbl(inCell.Value))
Debug.Print (Application.WorksheetFunction.exact(deltaCell, outCell - inCell))

Does anyone have any suggestions? Thank you for your assistance.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Since Exact isn’t supported by WorksheetFunction, use the equal operator to compare strings exactly as the Exact function:

CStr(deltaCell) = CStr(outCell - inCell)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading