Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Not recognising value

I need to delete any rows where the value in column I is "INCOMPLETE".
I tried writing the code myself but it wasn't recognising the cells
that said "Incomplete". So I have searched the forums to find the code
below which I thought would do the job with a bit of altering. However
on stepping through the code it is not recognising cells that say
INCOMPLETE either and is just continuing through the code without
executing the delete row.

Sub deleteincompleterows()

Dim rng As Range, cell As Range, arrVar As Variant
Dim strAddress1 As String, rngUnion As Range
Set rng = Range("I5:I8")

For Each arrVar In Array("INCOMPLETE*")
Set cell = rng.Find(arrVar, LookIn:=xlValues, Lookat:=xlWhole,
MatchCase:=True)

If Not cell Is Nothing Then
strAddress1 = cell.Address
Do
If rngUnion Is Nothing Then
Set rngUnion = cell
Else
Set rngUnion = Union(cell, rngUnion)
End If
Set cell = rng.FindNext(cell)
Loop While Not cell Is Nothing And _
cell.Address < strAddress1
End If
Next arrVar
If Not rngUnion Is Nothing Then
rngUnion.EntireRow.Delete
End If
End Sub

Is this an obvious problem with my code or is it a problem with the
values on my sheets?

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
recognising if a number is in a list [email protected] Excel Programming 0 August 28th 06 04:48 AM
Recognising which is the active sheet Blondegirl[_4_] Excel Programming 3 May 1st 06 01:21 PM
VLookup not recognising numbers Doug Excel Worksheet Functions 7 May 16th 05 04:05 PM
Recognising cell values Mikeymay[_2_] Excel Programming 5 August 18th 04 01:11 AM
Recognising '0.00' Stuart[_5_] Excel Programming 2 August 19th 03 03:56 PM


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