Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning Error from Functions
I want to return "#N/A" and "#DIV/0" errors from a user define
function. Can someone help? Thanks Leni -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning Error from Functions
Lenin,
Declare the function to return a Variant data type, and use CVErr to create an error value. For example Function Test() As Variant Test = CVErr(xlErrDiv0) ' or Test = CVErr(xlErrNA) End Function -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "LeninVMS " wrote in message ... I want to return "#N/A" and "#DIV/0" errors from a user defined function. Can someone help? Thanks Lenin --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning Error from Functions
cvErr(xlErrNA)
cvErr(xlErrDiv0) ? cvErr(xlErrNA) Error 2042 ? cvErr(xlErrDiv0) Error 2007 -- Regards, Tom Ogilvy "LeninVMS " wrote in message ... I want to return "#N/A" and "#DIV/0" errors from a user defined function. Can someone help? Thanks Lenin --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning Error from Functions
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula returning an error | Excel Worksheet Functions | |||
VLOOKUP returning a #VALUE! error and I've not idea why! HELP!!! | Excel Worksheet Functions | |||
SUMPRODUCT formula returning #VALUE! error | Excel Worksheet Functions | |||
Custom function returning VALUE error | Excel Discussion (Misc queries) | |||
Formula returning #N/A Error---why??? | Excel Worksheet Functions |