+ Reply to Thread
Results 1 to 3 of 3

User Form Problem - Autofilter Method of Range class failed

  1. #1
    Registered User
    Join Date
    05-29-2009
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003
    Posts
    1

    User Form Problem - Autofilter Method of Range class failed

    Hi i am trying to create a user form for entering in one sheet. It is still not complete.

    However in Procedure Wbs3Filter when called in a combobox change action it gives a Autofilter Method of Range Class Failed. Can someone please guide me what is wrong with the code


    Sub Wbs3Filter(Wbs2Code As String)

    Dim strWbs1Code As String, strWbs2Code As String
    Dim strWBS1Criteria As String, strWBS2Criteria As String
    Dim rngWbs3 As Range, rngWBS3Resz As Range

    strWbs1Code = Right(cbxActWBS1.Value, 2)
    strWBS1Criteria = strWbs1Code

    strWbs2Code = Right(Wbs2Code, 2)
    strWBS2Criteria = strWbs2Code

    Worksheets(4).Activate
    With ActiveSheet
    .AutoFilterMode = False

    With .Range("A1:I1")
    .AutoFilter
    .AutoFilter Field:=3, Criteria1:=strWBS1Criteria
    .AutoFilter Field:=4, Criteria1:=strWBS2Criteria
    End With

    End With

    Set rngWbs3 = Worksheets(4).UsedRange.SpecialCells(xlCellTypeVisible)
    Set rngWBS3Resz = Intersect(rngWbs3, Range("J2:J500"))
    rngWBS3Resz.Copy
    Range("AA1").Select
    Selection.PasteSpecial Paste:=xlPasteValues

    End Sub



    It returns an error 1004 Autofilter method of range property failed

    Need help urgently
    Attached Files Attached Files

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: User Form Problem - Autofilter Method of Range class failed

    I can't replicate that with your workbook. What are the exact steps you use?

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: User Form Problem - Autofilter Method of Range class failed

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ Reply to Thread

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