function shall retun #NV

  • Thread starter Thread starter Andreas Martin
  • Start date Start date
A

Andreas Martin

Hi all,

I try to write a function that returns a novalue ("#NV") under some
circumstances.
I don't know how to manage this, but it must be possible, cause:

function test(v)
test = v
end function

and "=test(#NV)" in a cell produce the novalue, I want to...

I tried:

function test()
test = evaluate("=#NV")
end function

but that doesn't work too. Has anyone an idea?


Kindly regards,
Andreas Martin
 
Hi
why not use the worksheet function
=NV()

if you need nit in a function use
function foo()
foo = CVErr(xlErrValue)
end function
 
Andreas,

Function Test()
Test = "#NV"
End Function

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi Frank,

yes, that's it! Many thanks! I looked up for a convert-function before, but
i wrapped it, cause I searched a CErr and not CVErr... :-(

BTW: NV() I tried too, but didn't work. Because I've the german version?
Anyway, CVErr works fine, thank you!


Regrards,
Andreas
 
Hi Bob,

no that would return a string literal. I want to return a real error
value...


Anyway, thank you,
Andreas
 
As I have never seen this real error #NV I assumed a string was what you
wanted. I was going to suggest #NA, but decided you really meant #NV

You can get #NA with

Function test()
test = CVErr(xlErrNa)
End Function


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top