Results 1 to 2 of 2

VBA | Advanced Filter | Run time error 1004 method range of object worksheet failed

Threaded View

  1. #1
    Registered User
    Join Date
    03-21-2013
    Location
    Columbia, SC
    MS-Off Ver
    Excel 2007
    Posts
    1

    VBA | Advanced Filter | Run time error 1004 method range of object worksheet failed

    I have modified code from a workbook developed by Contextures. I am getting a run time error on the following code:
    Option Explicit
    ' Developed by Contextures Inc.
    ' www.contextures.com
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rngCrit As Range
    
    Set rngCrit = wksCrit.Range("CriteriaRng")
    Application.EnableEvents = False
    
    Select Case Target.Address
        Case Range("SelCat").Address
            rngCrit.Cells(2, 1).Value = Target.Value
        Case Range("SelActor").Address
            rngCrit.Cells(2, 2).Value = Target.Value
    End Select
    
    If Range("SelCat").Value = "" Then
        rngCrit.Cells(2, 1).ClearContents
    End If
    If Range("SelActor").Value = "" Then
        rngCrit.Cells(2, 2).ClearContents
    End If
    
    If Not rngCrit Is Nothing Then
      wksMovies.Range("MovieList").AdvancedFilter _
        Action:=xlFilterCopy, _
          CriteriaRange:=rngCrit, _
          CopyToRange:=Range("ExtractMovies"), Unique:=False
    End If
    
    exitHandler:
        Application.EnableEvents = True
        Exit Sub
    errHandler:
        Resume exitHandler
    
    End Sub
    The line in red is where the error is occurring. Error number 1004: Method range of object _worksheet failed. I have attached a modified version of my workbook. I think that I have referenced something incorrectly, but I am not sure where to fix it.

    Any help is greatly appreciated.
    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. [SOLVED] Error 1004 - Method Range of Object Worksheet Failed
    By mrbickelsworth in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 02:18 PM
  2. Run time Error 1004 Method 'Range' object '_Worksheet 'failed
    By Monica1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2013, 07:42 AM
  3. Run Time error 1004 Method Select of Object Worksheet failed
    By AlexMach in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-14-2012, 03:07 AM
  4. Run-time error '1004': Method 'Range' of object '_Global' failed
    By claremount in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-26-2010, 08:01 AM
  5. Run time error 1004 - Method 'Range' of 'Object'_Global' failed
    By excelaspire0219 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-10-2009, 01:18 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