Results 1 to 17 of 17

Please Help - If then auto filter

Threaded View

  1. #1
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Exclamation Please Help - If then auto filter

    Please please help, I have been trying to figure out this code all week and can not get the IF statement to work. It works without the If statement (highlighted in red) that is selecting only the rows that say "Jane Doe". Does anyone have any suggestions?

    I attached a workbook of what I want it to look like. The Full tab has the raw data and the new tabs has the data filtered out how I want it to be.

    This is the code I have right now.

    Sub UseAutoFilterDead()
    Dim ctrl As Long
    
    ctrl = Sheet1.Range("E2:E1000").Value
    
    If ctrl = "Jane DOe ext 44723" Then
    
    Sheet1.AutoFilterMode = False
    
    With Sheet1.Range("A1:R10000")
        .AutoFilter Field:=10, Criteria1:="10", Operator:=xlTop10Items
        .SpecialCells(xlCellTypeVisible).Copy Sheet3.Range("A1")
    End With
    Sheet1.AutoFilterMode = False
    
    Sheet1.AutoFilterMode = False
    With Sheet1.Range("A1:R10000")
        .AutoFilter Field:=12, Criteria1:="10", Operator:=xlTop10Items
        .SpecialCells(xlCellTypeVisible).Copy Sheet4.Range("A1")
    End With
    Sheet1.AutoFilterMode = False
    
    Sheet1.AutoFilterMode = False
    With Sheet1.Range("A1:R10000")
        .AutoFilter Field:=14, Criteria1:="10", Operator:=xlTop10Items
        .SpecialCells(xlCellTypeVisible).Copy Sheet5.Range("A1")
    End With
    
    Sheet1.AutoFilterMode = False
    
    End If
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA - Auto Filter and make new sheets based on the filter values- Loop
    By Paul Cherian in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2017, 06:41 AM
  2. Auto refresh Auto filter excluding Zeros after chagnig date everytime
    By anwitha in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2015, 08:09 AM
  3. [SOLVED] Auto Populate cell based on auto filter selection from table in same sheet
    By missydanni in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2013, 05:03 PM
  4. Delete Rows hidden by either Auto Filter and Advanced Filter
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 10:29 AM
  5. [SOLVED] Advanced Filter results don't match auto filter
    By WaterWings in forum Excel General
    Replies: 1
    Last Post: 09-13-2012, 05:37 PM
  6. Auto Filter by InputBox - filter by user defined column
    By Originalgoth in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2010, 12:12 AM
  7. Replies: 1
    Last Post: 09-29-2005, 04:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1