Results 1 to 3 of 3

Error in VBA Code using AutoFilter

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    458

    Error in VBA Code using AutoFilter

    Hello everyone. I have a VBA code that I am using to filter data by using columns headers in the range A1 trough AU1. Specificaly column AI needs to be filtered with the criteria set to 3. Below is the code that I have come up with, and it errors out. Note that code does apply the filters, ait just does not filter down to the criteria. Any help on this would be greatly appreciated.

    Sub FilterToL3()
        Dim wb1         As Workbook
        Dim sPath1      As String
        Const sFileInp1 As String = "105_version1.xlsm"
        
        sPath1 = fPath & fDate & "_157\105_Reports\"
    
        Set wb1 = Workbooks.Open(sPath1 & sFileInp1)
        
        With ActiveSheet
            .AutoFilterMode = False
            .Range("A1:AU1").AutoFilter
            .Range("A1:AU1").AutoFilter Field:=35, Criteria1:=3
            
        End With
    
     
    
    End Sub
    Last edited by AnthonyWB; 04-21-2010 at 02:09 PM.

Thread Information

Users Browsing this Thread

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

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