Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detect #N/A or number
Hi all
I need to be able to detect whether a cell contains #N/A or alternatively a number If Cells(I - 1, HighestPColumnnumber).Number Then . . . -- Thanks in anticipation Peter Simonotti-Bircher SA MEDICAL EQUIPMENT Tel : +27 31 266 9422 Cell : +27 83 233 1628 - Peter +27 82 555 1192 - Marcelline Email: |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detect #N/A or number
Assume Range A1:B15
The Function to calculate number of cells containing all types of errors: €¢ {=SUM(IF(ISERROR(A1:B15),1))} The Function to calculate number of cells containing error type #N/A: €¢ {=SUM(IF(ISNA(A1:B15),1))} HTH, Ryan-- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Peter Bircher" wrote: Hi all I need to be able to detect whether a cell contains #N/A or alternatively a number If Cells(I - 1, HighestPColumnnumber).Number Then . . . -- Thanks in anticipation Peter Simonotti-Bircher SA MEDICAL EQUIPMENT Tel : +27 31 266 9422 Cell : +27 83 233 1628 - Peter +27 82 555 1192 - Marcelline Email: |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detect #N/A or number
Hi Peter,
Not sure if I understand your question properly or if ryguy has provided the answer you are looking for because I get the feeling you are looking for a VBA answer. However, thought I would post the following example to see if it helps. Note that a space and underscore at the end of a line is a line break in an otherwise single line of code. Dim i As Long For i = 1 To 10 If IsNumeric(Cells(i, 2)) Then MsgBox "Cell " & Cells(i, 2) _ .Address & "= " & Cells(i, 2).Value Else If WorksheetFunction.IsNA(Cells(i, 2)) Then MsgBox "Cell " & Cells(i, 2) _ .Address & "= #N/A" Else MsgBox "Cell " & Cells(i, 2) _ .Address & " Not Numeric or #N/A" End If End If Next i -- Regards, OssieMac |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How To Detect A Negative Number In A Cell | Excel Worksheet Functions | |||
How to detect use of DSNs? | Excel Programming | |||
How to detect row number of selected cells? | Excel Programming | |||
how to detect paste | Excel Programming | |||
How to detect current active sheet number | Excel Programming |