Thread: delete cells
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default delete cells

Assume the data is in column A.

Sub dltunder100()
Dim c As Range
lastRow = Cells(Rows.Count, 1).End(xlUp).Row
For Each c In Range("A1:A" & lastRow)
If c.Value < 100 Then
c.EntireRow.Delete 'can be changed to a specific range
End If
Next
End Sub

" wrote:

i have a worksheet with several columns, and i want to use one
specific colume as my reference, i.e. values under 100 in this column
as well as values/texts in the same rows should be deleted, basically
it's to delete a range of data based on certail value, is there a
way?
thanks a ton!