Consulting

Results 1 to 2 of 2

Thread: Filter and delete rows based on value from a cell

  1. #1
    VBAX Newbie
    Joined
    Sep 2018
    Posts
    1
    Location

    Filter and delete rows based on value from a cell

    Hello all

    Can you please help on this

    I have a worksheet with columns "A:AC" and I want to filter on Column "N" and delete all rows NOT equal to Sheet5.Range("C2").
    This is my code but it is not working

    With Sheets("Data")
          If .AutoFilterMode Then .AutoFilterMode = False
             Intersect(.UsedRange, .Range("N:N")).AutoFilter 1, "<>" & Sheet5.Range("C2")
             .AutoFilter.Range("N:N").EntireRow.Delete
             .AutoFilterMode = False
         End With

  2. #2
    Cross posted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •