• 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.

VBA code for deleting rows, using Name

Need a help, I need a VBA code for deleting rows from the table in Sheet Temp excluding status mention in Sheet Select
Status Mention in Sheet Select may change time to time (may increase or decrease also), so i was trying to use Name function, but unable to do so
 

Attachments

  • Need Help.xlsx
    16.5 KB · Views: 7
Try
Code:
Sub test()
    Application.ScreenUpdating = False
    With Sheets("temp").Cells(1).CurrentRegion
        .Parent.Select
        .AutoFilter 26, Application.Transpose(Sheets("select").Cells(1).CurrentRegion.Columns(1)), 7
        .SpecialCells(12).EntireRow.Select
        .AutoFilter
        Selection.EntireRow.Hidden = True
        On Error Resume Next
        .SpecialCells(12).EntireRow.Delete
        .EntireRow.Hidden = False
        On Error GoTo 0
        .Cells(1).Select
    End With
    Application.ScreenUpdating = True
End Sub
 
Back
Top