Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
generating a #VALUE
I have a UDF which, if it can't find what it's looking for, I want to return
and show #VALUE in the cell. Any ideas how do I do this? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
generating a #VALUE
Use the CVErr function to create an Error type Variant and return that as
the result of the function. Function Whatever() As Variant If Something Then Whatever = CVErr(xlErrValue) End If End Function -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "Smallweed" wrote in message ... I have a UDF which, if it can't find what it's looking for, I want to return and show #VALUE in the cell. Any ideas how do I do this? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
generating a #VALUE
One way might be to trying adding a number and a letter..
Function Test() Test = 1 + "a" End Function -- Hope that helps. Vergel Adriano "Smallweed" wrote: I have a UDF which, if it can't find what it's looking for, I want to return and show #VALUE in the cell. Any ideas how do I do this? Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
generating a #VALUE
Have your function return a variant
Function myFunc(arg1 as ...) as Variant 'some code here myFunc = CVErr(xlErrValue) end function Smallweed wrote: I have a UDF which, if it can't find what it's looking for, I want to return and show #VALUE in the cell. Any ideas how do I do this? Thanks. -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
generating a #VALUE
forcing an error in excel will give the results. This worked for me
Function test(target As Range) test.Value2 = "Error 2015" End Function "Smallweed" wrote: I have a UDF which, if it can't find what it's looking for, I want to return and show #VALUE in the cell. Any ideas how do I do this? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Generating a List | Excel Programming | |||
Generating Error for UDF | Excel Programming | |||
Generating list | Excel Worksheet Functions | |||
Generating Ranges in VBA | Excel Programming | |||
Generating reports | Excel Programming |