» Return error values from user defined functions using VBA in Microsoft Excel
CATEGORY - Custom Functions , Printing in VBA
VERSION - All Microsoft Excel Versions
With the example function below you can get user defined functions to return error values
just like the built in functions in Excel do.
Function DummyFunctionWithErrorCheck(InputValue As Variant) As VariantIf InputValue < 0 Then ' return an error valueDummyFunctionWithErrorCheck = CVErr(xlErrNA) ' retunerer #I/T!' xlErrDiv0, xlErrNA, xlErrName, xlErrNull, xlErrNum , xlErrRef, xlErrValueExit FunctionEnd If' do the calculationDummyFunctionWithErrorCheck = InputValue * 2End Function
Book Store:
Recommended Books:
- The Fall of Advertising and the Rise of PR
- Getting to Yes: Negotiating Agreement Without Giving In
- Financial Risk Manager Handbook, Second Edition
- Financial Peace: Revisited
- Financial Statements: A Step-By-Step Guide to Understanding and Creating Financial Reports
- AWAKEN THE GIANT WITHIN : HOW TO TAKE IMMEDIATE CONTROL OF YOUR MENTAL, EMOTIONAL, PHYSICAL AND FINANCIAL
No comments have been submitted.

