ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   delete cells (https://www.excelbanter.com/excel-programming/402702-delete-cells.html)

[email protected]

delete cells
 
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!

JLGWhiz

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!


JLGWhiz

delete cells
 
One posting will usually do it. See your first one.

" 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!



All times are GMT +1. The time now is 02:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com