View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Seeker Seeker is offline
external usenet poster
 
Posts: 137
Default Want to delete rows based on a condition

Typo "and = Date - 1", sori as keyboard not functioning very good.

"Seeker" wrote:

Hi Gord,
I would like to adopt your code also and tried in column B with = Date and
=Date 1 both work great, however, I would like to delet rows with Date less
than today but I was rejected with the "<", how could I accomplish the less
than effect please?
Rgds

"Gord Dibben" wrote:

I don't understand the "certain cell" bit.

A certain cell should have an address like A1 or B23

Maybe you meant certain column?

This will delete all rows with a certain value in any cell in Column A

Sub DeleteRows_With_Param()
FindString = "qwerty"
Set b = Range("A:A").Find(what:=FindString, lookat:=xlWhole)
While Not (b Is Nothing)
b.entirerow.Delete
Set b = Range("A:A").Find(what:=FindString, lookat:=xlWhole)
Wend
End Sub


Gord Dibben MS Excel MVP


On Fri, 11 Jul 2008 14:05:01 -0700, marcia2026
wrote:

I am trying to do a Loop/Until macro in order to delete all rows with a
certain value in a certain cell. The only thing I can find on deleting rows
requires me to specify the row number. That will be variable