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: 78
Default delete rows if data is either

I'm trying to delete rows based on whether the data in column G is "adj" or
"redi avg". I am using the following code, but it is only deleting the rows
with "adj" in the cell:

Dim lr As Long, i As Long
lr = ActiveSheet.Cells(Rows.Count, 7).End(xlUp).Row
For i = lr To 1 Step -1
With ActiveSheet
If .Cells(i, 7) = "adj" Or .Cells(i, 7) = "redi avg" Then
.Cells(i, 1).EntireRow.Delete
End If
End With
Next

Please let me know how to get the rows with "redi avg" to delete also.
Thanks!
 
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
automate delete rows without data Amir Excel Worksheet Functions 3 August 19th 09 03:38 PM
Delete rows with data AmyLynn9156 Excel Programming 3 July 10th 07 09:32 PM
How do I delete all rows that contain no red highlighted data? Linda Hudock Excel Discussion (Misc queries) 7 May 22nd 06 09:09 AM
Delete rows with no data Mindie Setting up and Configuration of Excel 1 November 30th 05 09:24 PM
Delete certain rows of data... RMJ Excel Programming 3 January 26th 04 08:30 AM


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