LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default How do I Delete Rows on Range Criteria for Column A Cells Not Equal to specific values ?

Hi J.P.,

Am Sat, 25 Apr 2015 20:51:04 +0200 schrieb Claus Busch:

Sub DeleteRows()


a better way:

Sub DeleteRows2()
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,F1PPM60549,F1PPM60623"

With Sheets("Invoices")
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
varData = .Range("A2:A" & 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 Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
 
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
Sum specific column rows based on 2 different column criteria Jack Excel Worksheet Functions 3 October 9th 08 05:03 PM
Delete Rows With Specific Text or Values Sean[_15_] Excel Programming 1 August 30th 06 10:23 PM
Delete rows if specific criteria not met. SITCFanTN Excel Worksheet Functions 3 July 5th 06 12:20 AM
Delete rows that do not meet specific criteria SITCFanTN Excel Programming 3 June 6th 06 04:36 PM
I want to delete certain rows based on specific criteria Alaphas Excel Programming 2 May 18th 05 11:06 PM


All times are GMT +1. The time now is 04:48 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"