+ Reply to Thread
Results 1 to 3 of 3

Copy unique values from autofilter

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,954

    Copy unique values from autofilter

    On my "View2Pivot" worksheet I have an autofilter applied. I want to copy only the unique, visible items from the second column in my autofilter range. I was hoping this code would do it for me, but I'm getting an error message saying "Object Variable or With Block Variable not set"

    Please Login or Register  to view this content.
    Here's the full macro:
    Please Login or Register  to view this content.
    Last edited by jomili; 12-07-2010 at 06:39 PM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,265

    Re: Copy unique values from autofilter

    You can't apply an advanced filter and an autofilter at the same time. You'll have to loop through the visible cells of the relevant column and add them to a collection (or dictionary) to get unique records.
    Remember what the dormouse said
    Feed your head

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,954

    Re: Copy unique values from autofilter

    I was afraid someone would say that. Oh well, back to the drawing board...

+ 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