Macro for auto deleting row if cell value = x

N

nancee

I'm looking for some visual basic help for the following scenario...

Column A contains cells values: x, y, z
I need macro to refer to column A, and delete entire row if cell value = y or z

I really appreciate your help! Thanks!
 
M

MSP77079

FirstRow = number of first row of data
myColumn = number of column that you want to examine
Set myRange = Cells(FirstRow, myColumn).CurrentRegion
LastRow = myRange.Cells(myRange.Cells.Count).Row

For myRow = LastRow to FirstRow step -1
if cells(myRow, myColumn) = "x" the
cells(myRow,myColumn).entirerow.delete
Next myRo
 
Top