Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default 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
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
How To Detect A Negative Number In A Cell Minitman Excel Worksheet Functions 7 March 13th 08 04:12 PM
How to detect use of DSNs? Paul Martin Excel Programming 0 May 30th 06 02:43 AM
How to detect row number of selected cells? Ivan Excel Programming 1 May 9th 06 05:43 AM
how to detect paste mjb267 Excel Programming 3 April 6th 04 07:54 PM
How to detect current active sheet number Mike Chen Excel Programming 3 April 3rd 04 04:41 PM


All times are GMT +1. The time now is 09:39 PM.

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"