Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that deletes rows with "0" value cells
Hi,
I have several worksheets with data. I'd like to specify a column and wherever there is a 0 value in that column, the macro will delete the whole row it is in. The column to look for the 0 in is different in each of my worksheets so somehow i have to specify which one it is to the macro beforhand. any help aprecciated, Steven. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro that deletes rows with "0" value cells
Try this
Sub m() colabel = InputBox("column label ?") lrow = Cells(Rows.Count, colabel).End(xlUp).Row For i = lrow To 1 Step -1 If Cells(i, colabel) = 0 Then Rows(i).Delete Next i End Sub -- Regards "steven" wrote in message ... Hi, I have several worksheets with data. I'd like to specify a column and wherever there is a 0 value in that column, the macro will delete the whole row it is in. The column to look for the 0 in is different in each of my worksheets so somehow i have to specify which one it is to the macro beforhand. any help aprecciated, Steven. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" | Excel Discussion (Misc queries) | |||
What is a function in VBA EXCEL witch finds a string like "not" in cell and then deletes a row with this cell? | Excel Programming | |||
What is a function in VBA EXCEL witch finds a string like "not" in cell and then deletes a row with this cell? | Excel Worksheet Functions | |||
Using "Cells" to write "Range("A:A,H:H").Select" | Excel Programming |