Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for auto deleting row if cell value = x
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! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for auto deleting row if cell value = x
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 -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel auto deleting zero at start of cell - change? | Excel Discussion (Misc queries) | |||
Auto run macro depend on cell value | Excel Worksheet Functions | |||
Macro Help Needed: Comparing cell values and deleting rows | Excel Discussion (Misc queries) | |||
Excel VBA - Newbie: Auto deleting cell value | Excel Programming | |||
Deleting Cell Name from Macro | Excel Programming |