+ Reply to Thread
Results 1 to 6 of 6

Error with this code, what's wrong?

  1. #1
    Registered User
    Join Date
    05-22-2008
    Posts
    74

    Error with this code, what's wrong?

    This keeps generating error 91, Object vVariable or with block variable not set, at the Set line. Since I am not using a with block it has to be the object variable, but I can't figure out what I am missing.

    Please Login or Register  to view this content.
    Thanks again.
    Scott
    The harder it gets the happier I am.
    Finally got my signature set up!

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    You don't appear to be setting up AutoFilter. Advanced Filter is a different animal.

  3. #3
    Registered User
    Join Date
    05-22-2008
    Posts
    74
    OK, so how do I do the advanced filter then set a range to the results? I did try changing autofilter to advanced filter and got an error say that it didn't support that method.

    I need to read the results of the unique filter. The only way to get a unique list that I know of is to use the advanced filter. Now Excel 2007 help files just plain suck, so there may be something in help to answer my question, but it is eluding me.

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    I think you'd be better off copying to another location and then setting the range variable to that location.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Registered User
    Join Date
    05-22-2008
    Posts
    74
    Thanks Mikerickson! So simple. However the loop is running away. It seems that xlCellTypeVisible is a never ending list. When the loop finally finishes I'll modify it to stop and just do a "For Next" instead of a "For Each".

    Thanks again for your help.

+ 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