LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Deleting Rows on condition & Long processing time

Problem # 1 : Delete Rows where
Col "A" Cells are < "F1PP601
Row 1 Col A Col B
Row 2 F601 AWP
Row 3 F1PPM60602 AW2
Row 4 F1PPM60601 AWP
Row 5 F1PPM60601 AW3
Row 6 F1PPM60603 AW2
Row 7 F1PPM60602 AW1
Row 8 F1PPM60601 AW$
..
Sub DeleteRows()
Dim strCheck As String
Dim LRow As Long, i As Long
Dim varData As Variant

With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

strCheck = "F1PPM60601,F1PPM60602"

With Sheets("PM4")
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
varData = .Range("P2:P" & LRow)
For i = UBound(varData) To LBound(varData) Step -1
If InStr(strCheck, varData(i, 1)) = 0 Then
Rows(i + 1).Delete
End If
Next
End With
With Sheets("PM4")
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
varData = .Range("BE2:BE" & LRow)
For i = UBound(varData) To LBound(varData) Step -1
With .Cells(i, "BE")
If Not IsError(.Value) Then
If .Value = "AWP" Then .EntireRow.Delete
End If
End With
Next
End With
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Processing taking a really long time SS Excel Discussion (Misc queries) 2 March 17th 09 02:19 PM
deleting rows in a worksheet if condition is met destine Excel Discussion (Misc queries) 3 November 20th 08 01:39 PM
removing blank rows taking a long time tabbicat Excel Programming 4 May 11th 07 05:55 PM
deleting the rows depending on the result of a condition involving two columns. pkseelam Excel Programming 2 August 26th 03 02:52 PM
deleting rows, takes a long time! Nick Excel Programming 1 July 22nd 03 03:38 AM


All times are GMT +1. The time now is 04:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"