View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Select all cells in a range with a certain numerical value

Hi
one way to delete them:
Sub delete_rows()
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For row_index = lastrow To 1 Step -1
If Cells(row_index, "A").Value =1 then
Cells(row_index, "A").clearcontents
End If
Next
Application.ScreenUpdating = True
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany


nathan wrote:
I have a column with numbers in it. I want to select all cells with

a
certain value, say 1, so that I may delete those cells. It's the
method of selecting the cells I can't figure out (I know how to
delete them). Have fooled around with SpecialCells and Find with no
luck. Thanks much.