Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA and #N/A


I can check whether a cell has a value of #N/A by using
WorksheetFunction.IsNa(CellAddress).

-But can I put a #N/A value into a cell?- There seems to be no
equivalent of the
NA() function that you can use directly in a worksheet. Something
like
Range(CellAddress).Value=NA() ???

Putting the string equivalent "#N/A" into the cell doesn't help,
because the spreadsheet has to function in a multilanguage environment.


--
rvExcelNewTip
------------------------------------------------------------------------
rvExcelNewTip's Profile: http://www.excelforum.com/member.php...o&userid=15668
View this thread: http://www.excelforum.com/showthread...hreadid=376276

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default VBA and #N/A

One way:

Range(CellAddress).Value = CVErr(xlErrNA)

In article
,
rvExcelNewTip
wrote:

I can check whether a cell has a value of #N/A by using
WorksheetFunction.IsNa(CellAddress).

-But can I put a #N/A value into a cell?- There seems to be no
equivalent of the
NA() function that you can use directly in a worksheet. Something
like
Range(CellAddress).Value=NA() ???

Putting the string equivalent "#N/A" into the cell doesn't help,
because the spreadsheet has to function in a multilanguage environment.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default VBA and #N/A

Maybe you could try:

with range(celladdress)
.formula = "=na()"
.value = .value
end with

But I bet this would work, too:

range(celladdress).value = cverr(xlerrna)

rvExcelNewTip wrote:

I can check whether a cell has a value of #N/A by using
WorksheetFunction.IsNa(CellAddress).

-But can I put a #N/A value into a cell?- There seems to be no
equivalent of the
NA() function that you can use directly in a worksheet. Something
like
Range(CellAddress).Value=NA() ???

Putting the string equivalent "#N/A" into the cell doesn't help,
because the spreadsheet has to function in a multilanguage environment.

--
rvExcelNewTip
------------------------------------------------------------------------
rvExcelNewTip's Profile: http://www.excelforum.com/member.php...o&userid=15668
View this thread: http://www.excelforum.com/showthread...hreadid=376276


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA and #N/A


-CVErr(xlErrNA)- works like a charm. Thanks

--
rvExcelNewTi
-----------------------------------------------------------------------
rvExcelNewTip's Profile: http://www.excelforum.com/member.php...fo&userid=1566
View this thread: http://www.excelforum.com/showthread.php?threadid=37627

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"