Delete the rows having value <=0.09

User avatar
PRADEEPB270
3StarLounger
Posts: 354
Joined: 27 Oct 2013, 15:11
Location: Gurgaon INDIA

Delete the rows having value <=0.09

Post by PRADEEPB270 »

I want to delete the rows in attach file having value <=0.09 in column 'L'.But I am unable to do this.Perhaps,any step left by me. I don't know.Please help me in this correction.
Regards

Pradeep Kumar Gupta
INDIA

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Delete the rows having value <=0.09

Post by Rudi »

You can use a filter to do that.

If you activate the autofilter on the Data ribbon (so that it adds the filter arrows to each of the column headings)
Then filter that column for the values equal to or less than 0.09 (less an equals 0.09)
Then select the entire rows that have been filtered and delete them
Then unfilter to show all the recodes again.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Delete the rows having value <=0.09

Post by Rudi »

Another option is to use a formula:
In column M and cell M2 enter this formula: =IF(L2<=0.09,NA())
The fill the formula down the column
Then select column M and press F5 to access the Go To feature and select Special
Select Formulas and ensure only the Error option is active
Press OK
Right click on any selected cell in column M
Select delete entire row
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
PRADEEPB270
3StarLounger
Posts: 354
Joined: 27 Oct 2013, 15:11
Location: Gurgaon INDIA

Re: Delete the rows having value <=0.09

Post by PRADEEPB270 »

Rudi,thanks for the valuable suggestions.
But can you modify my VBA codes?
Regards

Pradeep Kumar Gupta
INDIA

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Delete the rows having value <=0.09

Post by Rudi »

PRADEEPB270 wrote:Rudi,thanks for the valuable suggestions.
But can you modify my VBA codes?
Hi Pradeep, I will have a look at it when I get into work this morning. My reply can through on my iPad and on this device I cannot open the workbook and see the code.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Delete the rows having value <=0.09

Post by Rudi »

Here is the code...
If you wrote the code currently in the workbook, it was close to being correct :smile:
Well done!!!

Code: Select all

Sub DeleteInfo()
Dim r As Range, m As Long
    Application.ScreenUpdating = False
    ' Rows with value <=.09 in column L
    Set r = Range("L5", Range("L" & Rows.Count).End(xlUp))
    For m = r.Cells.Count To 1 Step -1
        If r.Cells(m).Value <= 0.09 Then
            r.Cells(m).EntireRow.Delete
        End If
    Next m
    r.Cells(1).Select
    Application.ScreenUpdating = True
End Sub
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
PRADEEPB270
3StarLounger
Posts: 354
Joined: 27 Oct 2013, 15:11
Location: Gurgaon INDIA

Re: Delete the rows having value <=0.09

Post by PRADEEPB270 »

Thanks Rudi for your nice support.Very glad to find it your awesome help.
Regards

Pradeep Kumar Gupta
INDIA