• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

delete unnecessary data using vba code

Amit Modi

Member
hi guys,

please find my querry in attached sheet. And please help me if possible.according to my data and orientation of data I had also provided logic please help me id possible.
thanks'
 

Attachments

  • Sample bom.xlsx
    22.6 KB · Views: 6
I think this will do what you want nicely.
Code:
Sub DeleteSubLevels()
Dim lastRow As Long
Application.ScreenUpdating = False
With ActiveSheet
    lastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
    .Range("B10:B" & lastRow).AutoFilter field:=1, Criteria1:=">1"
    On Error Resume Next
    .Range("B11:B" & lastRow).EntireRow.SpecialCells(xlCellTypeVisible).Delete
    On Error GoTo 0
    .AutoFilterMode = False
End With
Application.ScreenUpdating = True
End Sub
 
Back
Top