Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Member
 
Posts: 70
Default Type Mismatch Error on IF conditional

I have to do a Vlookup on a previous day's sheet to find matching names and then delete the rows with the ones that match, leaving only the new names. I've tried labeling matches as "old" and new ones as "new", but I'm still trying to get it to work without relabeling the results. Currently, the new ones show up as #N/A errors, and the matches list the matching names. This is what I've got so far:

Code:
        Last = Cells(Rows.Count, "C").End(xlUp).Row
        For i = Last To 1 Step -1
        If (Cells(i, "C").Value) < xlErrNA Then
            Cells(i, "A").EntireRow.Delete
        End If
This works until it finds a #N/A, and then it gives me a type mismatch error. I'm assuming this occurs because it's an error instead of a value, but I'm not sure how to fix it. Any help is appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Type Mismatch Error on IF conditional

hi KeriM,

If Not IsError(Cells(i, "C").Value) Then

--
isabelle



Le 2012-09-19 10:11, KeriM a écrit :
I have to do a Vlookup on a previous day's sheet to find matching names
and then delete the rows with the ones that match, leaving only the new
names. I've tried labeling matches as "old" and new ones as "new", but
I'm still trying to get it to work without relabeling the results.
Currently, the new ones show up as #N/A errors, and the matches list the
matching names. This is what I've got so far:


Code:
--------------------


Last = Cells(Rows.Count, "C").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "C").Value) < xlErrNA Then
Cells(i, "A").EntireRow.Delete
End If


--------------------


This works until it finds a #N/A, and then it gives me a type mismatch
error. I'm assuming this occurs because it's an error instead of a
value, but I'm not sure how to fix it. Any help is appreciated!




  #3   Report Post  
Member
 
Posts: 70
Default

Quote:
Originally Posted by isabelle View Post
hi KeriM,

If Not IsError(Cells(i, "C").Value) Then
That works perfectly! Thanks Isabelle!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Type Mismatch Error on IF conditional

you're welcome! ..feedback is always appreciated!

--
isabelle


Le 2012-09-20 11:06, KeriM a écrit :
isabelle;1605675 Wrote:
hi KeriM,

If Not IsError(Cells(i, "C").Value) Then



That works perfectly! Thanks Isabelle!




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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
runtime error 13 - type mismatch error in Excel 97 on Citrix Kevin Maher Excel Programming 7 March 8th 08 11:48 AM
Conditional Formatting - Run Time Error '13' Type Mismatch Error ksp Excel Programming 0 July 11th 06 07:06 AM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM


All times are GMT +1. The time now is 03:17 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"