Search : in
By :

Conditionally deleting rows in excel 2007

Last answer on Oct 21, 2009 11:51:24 am BST Alta, on Oct 20, 2009 6:15:38 pm BST 
 Report this message to moderators

Hello,

I'm hoping someone here might be able to help me with this. I have a spreadsheet where column A is a project name then columns B, C and D are financial data for the specific project. What I would like to do is delete the entire row for the project only if columns B, C and D ALL contain Zero's.

I can set up a filter and filter out zero's for 1 specific column, but in many of the rows only 1 or 2 of the 3 columns are zero's so that does not work.

Any help is appreciated, thanks.

D

Configuration: Windows 7 Internet Explorer 8.0, Excel 2007

Best answers for « Conditionally deleting rows in excel 2007 » in :
[VBA] Deleting a word in a range of cell Show[VBA] Deleting a word in a range of cell In the case you want to delete a word in a sentence, just create a small macro that removes the word. But it will become difficult when you have word like, for example, "Theword" or "THEWORD" or...
Delete duplicates in an Excel column ShowDelete duplicates in an Excel column To remove duplicates in an Excel column: Click on the Data menu Filter Advanced Filter In this menu, select the column where the duplicates Check the box "Extract without duplication"...
Colouring cells on conditions ShowColouring cells on conditions There are many pratical functions under Excel which is not commonly used. Example: If you wish a cell automatically turns red (or other formatting border, frame etc) under one condition: a result, a...
Download XLS (Excel) to DBF Converter ShowDescription The application is designed by WhiteTown Software. XLS (Excel) to DBF Converter is a tool that enables you to convert your XLS files to DBF format quickly and easily. Simple and easy to use, the application has been awarded from various...
Spreadsheets - Conditional expressions ShowWhat is a Conditional Structure? Conditional structures are instructions that allow to test if a condition is true or not. Conditional structures may be associated together. To successfully execute these tests using logical functions, spreadsheets...

1

aquarelle, on Oct 20, 2009 8:58:54 pm BST

Hello,

Try with this macro (I presumed that the first row contained the titles).

Public Sub DELETE_Rows_CellZero_Col_B_C_D()
Dim x As Long
Dim y As Long
x = Range("C65536").End(xlUp).Row

For y = x To 2 Step -1

    If Cells(y, 2).Value = 0 And Cells(y, 3).Value = 0 And Cells(y, 4).Value = 0 Then
    
        Rows(y).Delete
    
    End If

Next y
End Sub


Best regards "Pour trouver une solution à ses problèmes, il faut s'en donner la peine."

Reply to aquarelle

2

 Excelguru, on Oct 21, 2009 11:51:24 am BST

Hello

Just a asuggestion
In a new column add the three columns and filter for 0 A wise man once said, 'I complained that I had no shoes unti­l I met a man who had no feet.'
I am interested in financial Modelling and custom excel deve­lopment with excel macros.

Reply to Excelguru