There's nothing built into .specialcells to look for an individual value (like 0
or 1).
But if you don't have any errors in that range, you could change the 0s (or 1s)
to #n/a's and then use your existing code.
You could always loop through the cells.
Option Explicit
Sub testme()
Dim myCell As Range
Dim myRng As Range
With ActiveSheet
Set myRng = .Range(.Cells(1, 22), .Cells(.Rows.Count, 22).End(xlUp))
For Each myCell In myRng.Cells
If IsEmpty(myCell) Then
'skip it??
Else
If myCell.Value = 0 _
Or myCell.Value = 1 Then
Intersect(.Range("V:AB"), myCell.EntireRow).ClearContents
End If
End If
Next myCell
End With
End Sub
Tempy wrote:
>
> Good Morning, i got the following code from Tom Ogilvy which works
> really great & would like to know if one can use the same formula to
> search for a number e.g. "0" or "1" ?
>
> On Error Resume Next
> set rng = columns(22).Specialcells(xlConstants,xlErrors)
> On Error goto 0
> If not rng is nothing then
> Intersect(Range("V:AB"),rng.EntireRow).ClearContents
> End If
>
> Sorry for the ignorance, but i am fairly new to this game
>
> Tempy
>
> *** Sent via Developersdex http://www.developersdex.com ***
--
Dave Peterson
Bookmarks