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: 177
Default macro to delete on a condition

Hi,

I am trying to delete entire rows based on a condition. My condition is
simple, I put the word "delete" in column b of the worksheet. If it has
"delete" then wa lah! Its supposed to be gone. Except I can't figure out
how to get it done. I've tried a different criteria with putting in a number
instead but I am useless here. Please help?

Todd

Sub deleteif()
On Error Resume Next
For i = Cells(Rows.Count, "a").End(xlUp).Row To 1 Step -1
If UCase(Cells(i, "c")) = "delete" Then
EntireRow.Delete
End If
Next i
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
Delete Macro with OR/ELSE condition Mike Excel Discussion (Misc queries) 5 January 11th 10 09:08 PM
Delete Row with condition puiuluipui Excel Discussion (Misc queries) 4 June 12th 09 01:49 PM
Macro to delete rows based on a condition Darrilyn Excel Worksheet Functions 1 September 6th 07 12:12 AM
Can I delete an entire row if condition is not met? Christine Excel Worksheet Functions 8 May 4th 06 09:47 AM
delete rows with certain condition Grey Excel Programming 2 December 19th 03 12:05 PM


All times are GMT +1. The time now is 12:58 PM.

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

About Us

"It's about Microsoft Excel"