PC Review


Reply
Thread Tools Rate Thread

determine if cell is #N/A

 
 
=?Utf-8?B?Q2xheW1hbg==?=
Guest
Posts: n/a
 
      19th Jun 2007
I would like to find out if only a certain cell is #N/A due to faulty data
coming in. Will OnError allow me to prompt the user to input data for the
faulty cell? Or, can I just check for an error in the cell and call a
userform iwth the input?

Code:
For ediro = 4 To 199
With edi
If .Cells(ediro, 40).Type = xlerror Then
' Form_VacRate will accept input from the user to enter into .Cells(ediro,40)
With Form_VacRate
.TBempname = empname
.TBempname.Locked = True
.TBfilenum = empnum
.TBfilenum.Locked = True
.Show
End If
vacation = .Cells(ediro, 40).Value
End With
next ediro
--
Adios,
Clay Harryman
 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      19th Jun 2007
Clay,

You can adapt the following code to suit your needs.

Dim R As Range
Dim V As Variant
Set R = Range("A1")
If IsError(R) = True Then
If R.Value = CVErr(xlErrNA) Then
Debug.Print "N/A ERROR"
Else
Debug.Print "OTHER ERROR"
End If
Else
Debug.Print "NO ERROR"
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)



"Clayman" <(E-Mail Removed)> wrote in message
news:023F07FD-541D-4FDF-80D5-(E-Mail Removed)...
>I would like to find out if only a certain cell is #N/A due to faulty data
> coming in. Will OnError allow me to prompt the user to input data for the
> faulty cell? Or, can I just check for an error in the cell and call a
> userform iwth the input?
>
> Code:
> For ediro = 4 To 199
> With edi
> If .Cells(ediro, 40).Type = xlerror Then
> ' Form_VacRate will accept input from the user to enter into
> .Cells(ediro,40)
> With Form_VacRate
> .TBempname = empname
> .TBempname.Locked = True
> .TBfilenum = empnum
> .TBfilenum.Locked = True
> .Show
> End If
> vacation = .Cells(ediro, 40).Value
> End With
> next ediro
> --
> Adios,
> Clay Harryman


 
Reply With Quote
 
=?Utf-8?B?Q2xheW1hbg==?=
Guest
Posts: n/a
 
      19th Jun 2007
Thank you.

I guess what I was looking for was the CVErr(xlErrNA).

I'll get rollin' on it!
--
Adios,
Clay Harryman


"Chip Pearson" wrote:

> Clay,
>
> You can adapt the following code to suit your needs.
>
> Dim R As Range
> Dim V As Variant
> Set R = Range("A1")
> If IsError(R) = True Then
> If R.Value = CVErr(xlErrNA) Then
> Debug.Print "N/A ERROR"
> Else
> Debug.Print "OTHER ERROR"
> End If
> Else
> Debug.Print "NO ERROR"
> End If
>
>
> --
> Cordially,
> Chip Pearson
> Microsoft MVP - Excel
> Pearson Software Consulting
> www.cpearson.com
> (email on the web site)
>
>
>
> "Clayman" <(E-Mail Removed)> wrote in message
> news:023F07FD-541D-4FDF-80D5-(E-Mail Removed)...
> >I would like to find out if only a certain cell is #N/A due to faulty data
> > coming in. Will OnError allow me to prompt the user to input data for the
> > faulty cell? Or, can I just check for an error in the cell and call a
> > userform iwth the input?
> >
> > Code:
> > For ediro = 4 To 199
> > With edi
> > If .Cells(ediro, 40).Type = xlerror Then
> > ' Form_VacRate will accept input from the user to enter into
> > .Cells(ediro,40)
> > With Form_VacRate
> > .TBempname = empname
> > .TBempname.Locked = True
> > .TBfilenum = empnum
> > .TBfilenum.Locked = True
> > .Show
> > End If
> > vacation = .Cells(ediro, 40).Value
> > End With
> > next ediro
> > --
> > Adios,
> > Clay Harryman

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
In-cell formula/function to determine the color of a cell? sherifffruitfly Microsoft Excel Discussion 3 16th Nov 2008 07:47 PM
in vba what command is used to determine if a particular cell on a particular sheet changed? some kind of event? how to get the old and new value of the cell? Daniel Microsoft Excel Worksheet Functions 1 23rd Jun 2005 07:53 PM
in vba what command is used to determine if a particular cell on a particular sheet changed? some kind of event? how to get the old and new value of the cell? Daniel Microsoft Excel Discussion 1 23rd Jun 2005 07:44 PM
Determine Users Login ID & set cell value based on a changed cell DTM Microsoft Excel Programming 4 10th Mar 2004 09:19 PM
I need to determine a cell range based on a blank cell Katrina Microsoft Excel Worksheet Functions 2 3rd Jul 2003 09:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:48 PM.