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: 34
Default Combine deletion Criteria

Hello,

I have to delete rows meeting any of several criteria.
The way I have it now, It searches the same list several times.

Can the following be combined somehow???

Range("B27").Activate
Do
If Left(ActiveCell.Value, 3) = "CA_" Then
Selection.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell)
ActiveCell.Offset(-2, 0).Select
Do
If Left(ActiveCell.Value, 6) = "Undef_" Then
Selection.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell)

ActiveCell.Offset(-2, 0).Select
Do
If Left(ActiveCell.Value, 7) = "Target_" Then
Selection.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell)

With ActiveSheet
.Rows(1).Insert
.Range(MYCOL & 1).Value = "Temp"
.UsedRange
With Intersect(.Columns(MYCOL), .UsedRange)
.AutoFilter Field:=1, Criteria1:="*CA-*"
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
.UsedRange
End With

 
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
How do I combine worksheets w/o enough rows to combine? Amanda W. Excel Worksheet Functions 3 June 9th 09 07:26 AM
Combine cells with the same reference and combine quantities brandon Excel Discussion (Misc queries) 2 September 17th 08 05:44 PM
Need to combine countIF with AND for selection criteria MikeB Excel Discussion (Misc queries) 1 June 18th 08 01:58 AM
Improve autofilter combine conditionals with filter criteria dmcauli3 Excel Worksheet Functions 0 May 13th 05 01:27 PM
How to combine 2 different SUMPRODUCT criteria into one cell????? Tourcat Excel Worksheet Functions 4 February 10th 05 07:25 AM


All times are GMT +1. The time now is 05:36 AM.

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"