Results 1 to 5 of 5

Autofilter Syntax

Threaded View

stockgoblin42 Autofilter Syntax 11-22-2012, 07:23 AM
Norie Re: Autofilter Syntax 11-22-2012, 07:31 AM
stockgoblin42 Re: Autofilter Syntax 11-22-2012, 08:30 AM
Sean Thomas Re: Autofilter Syntax 11-22-2012, 07:40 AM
Norie Re: Autofilter Syntax 11-22-2012, 07:57 AM
  1. #1
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Autofilter Syntax

    Hi,

    Why do I get a break "Autofilter method of range class failed" with this? Where's the error?


    Dim Lastrow As Long
        
    Range("B:B").AutoFilter Field:=2, Criteria1:="=" > "&’Data’!$M$20", Operator:=xlOr, Criteria2:="=" < "&’Data’!$M$19"
    Lastrow = Range("B" & Rows.Count).End(xlUp).Row
    
    If Lastrow > 2 Then Range("A2:A" & Lastrow).SpecialCells(xlCellTypeVisible).EntireRow.DELETE xlShiftUp
    
    ActiveSheet.AutoFilterMode = False
    Last edited by stockgoblin42; 11-22-2012 at 08:32 AM.

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