Results 1 to 15 of 15

Thread: VBA Autofilter 3 Criteria

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    VBAX Expert
    Joined
    Sep 2016
    Posts
    788
    Location
    Option Explicit
    
    
    Sub test3()
        Dim r As Range
        Dim c As Range     
        Set r = Range("A7")
        Set r = Range(r, r.CurrentRegion(r.CurrentRegion.Count))
        Set c = r.Resize(2, 3).Offset(r.Rows.Count + 1)     
        c.Cells(1, 1).Value = r.Cells(1, 5).Value
        c.Cells(1, 2).Value = r.Cells(1, 15).Value
        c.Cells(1, 3).Value = r.Cells(1, 15).Value
        c.Rows(2).Value = Array("CP", "<>CA", "<>RJ")
        r.AdvancedFilter xlFilterInPlace, c
        c.ClearContents     
    End Sub
    Last edited by Aussiebear; 01-26-2025 at 08:00 PM.

Posting Permissions

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