Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I force my Excel/VBA function to return #N/A ?

Status
Not open for further replies.

MigrantFirmWorker

Programmer
Apr 9, 2003
54
US
A typical error from the canned Excel functions is '#N/A'. I would like my function to do the same under appropriate conditions.

The Excel function NA() will return this value in the worksheet. I tried

return Application.WorksheetFunction.NA()

but VBA doesn't seem to recognize this one. Any ideas?

Chris

-------------------------------------------------------------
"Don't be deceived. We're all temporary employees.
 


Code:
Dim x
[A1] = "=NA()"
x = [A1]

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Thanx. Do you know of any way to do it without having a dedicated cell in the workbook to generate the value/

Chris

-------------------------------------------------------------
"Don't be deceived. We're all temporary employees.
 




Code:
y = xlErrNA

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Thanx.

Chris

-------------------------------------------------------------
"Don't be deceived. We're all temporary employees.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top