Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is the model of the code I'm using -- this come from
http://www.rondebruin.nl/delete.htm Dim Firstrow As Long Dim Lastrow As Long Dim Lrow As Long Dim CalcMode As Long Dim ViewMode As Long With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With ViewMode = ActiveWindow.View ActiveWindow.View = xlNormalView Firstrow = ActiveSheet.UsedRange.Cells(1).Row Lastrow = ActiveSheet.UsedRange.Rows.Count + Firstrow - 1 With ActiveSheet .DisplayPageBreaks = False For Lrow = Lastrow To Firstrow Step -1 If IsError(.Cells(Lrow, "A").Value) Then 'Do nothing, This avoid a error if there is a error in the cell ElseIf .Cells(Lrow, "A").Value = "ron" Then .Rows(Lrow).Delete 'This will delete each row with the Value "ron" in Column A, case sensitive. End If Next End With ActiveWindow.View = ViewMode With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub __________________________________________________ __ Here is my situation and my questions: In Column A on my spreadsheet, there is data like this: AR3303 AR4055 Subtotal Blank Cell (and row) Blank Cell (and row) AR9999 DP3838 DP3923 DP3932 What I want to do is delete all rows that do NOT contain the DP in the first cell (Column A cell). I think I could do this somehow using a LEFT function and obviously an IF NOT function somehow, but I'm having problems tweaking it to do it this way. Can anybody help? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting rows meeting certain criteria in a particular column | Excel Discussion (Misc queries) | |||
Deleting entire rows based on certain criteria | Excel Programming | |||
Deleting rows based on multiple criteria | Excel Programming | |||
Deleting rows based on cell criteria | Excel Programming | |||
Deleting rows based on criteria | Excel Programming |