Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CH CH is offline
external usenet poster
 
Posts: 49
Default How to recognise "#N/A"

I have a program and I saw some of the cells having "#N/A"

I wish to have excel delete its cell content if encounter this value.
eg. If activecell.value = "#N/A".

However, excel gave me a "type mismatch" error.

How can I overcome this?

Please help. Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default How to recognise "#N/A"

Hi,

With following test ...
=IF(ISNA(A1),"",A1)

HTH
Cheers
Carim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default How to recognise "#N/A"

On Tue, 29 Aug 2006 00:18:01 -0700, ch wrote:

I have a program and I saw some of the cells having "#N/A"

I wish to have excel delete its cell content if encounter this value.
eg. If activecell.value = "#N/A".

However, excel gave me a "type mismatch" error.

How can I overcome this?

Please help. Thanks.


Try this:

======================
Option Explicit
Sub clearNA()
Dim c As Range
Set c = [a1]

If IsError(c.Value) Then
If c.Value = CVErr(xlErrNA) Then
c.ClearContents
End If
End If

End Sub
=========================
--ron
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
How to get excel to recognise "infinity" for asymptotes in charts Joey Jubb Charts and Charting in Excel 2 March 19th 06 12:53 PM
How can I get a data table to recognise and display "N/A"? Jennifer Excel Discussion (Misc queries) 0 March 16th 06 05:51 PM


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

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

About Us

"It's about Microsoft Excel"