+ Reply to Thread
Results 1 to 4 of 4

Filtering a Filtered Range

  1. #1
    Registered User
    Join Date
    09-02-2008
    Location
    Holland, MI
    Posts
    4

    Filtering a Filtered Range

    Hello all!

    First post; I'm hoping to get some help on a programing issue I'm having. I'm pretty savvy in Excel, but I'm learning VBA trial and error style.


    I'm making a sheet that will track and record defect data for my line operators. I have the user entering data into excel and then exporting that data into an access database using a macro. I can later import specific data back into the excel page to generate a report. All that is working fine, but I'm having a problem programing filters to further manipulate the data.

    I first filter the imported range to pull out specific operators etc. From there I wanted to do a unique filter to display the individual operators; from there I can do a CountIF to find the number of times each operator shows up. I really want to get the unique filter to work so that I don't have to keep a database of operator names.

    The code I have is simple:

    Please Login or Register  to view this content.
    If I do the unique filters manually, they work. If I do one manually and then run the macro, they both work. If I just run the macro, the 1st filter works, and then the the 2 unique filters only return the column heading. It's as if Excel isn't seeing that the data is there. I'm at a complete loss, and I can't seem to find any help online. Anyone have an idea?

    Thanks a ton!
    Nate
    Last edited by rylo; 09-02-2008 at 10:22 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Nate

    Firstly, can you please review the forum rules regarding wrapping code. I've edited your post for you this time. Makes things much easier to read.

    When you manually do the filter, you would be removing the criteria range. The only way I could replicate this in code was to explicitly remove it from the first unique action. See if this works for you.


    Please Login or Register  to view this content.
    rylo

  3. #3
    Registered User
    Join Date
    09-02-2008
    Location
    Holland, MI
    Posts
    4
    I replaced mine with yours and it works like a champ. I'm annoyed that omitting that would cause problems, it doesn't show up when you record the macro' when I looked up the method in the help I figured it wasn't needed as there was no criteria. Thanks a ton, I've been banging my head against the table all day. Sorry about the wrapping code. I'll figure ou how to put it in the box for next time.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    At the top of the programming forum is a link to the forum rules. Follow the prompts and item 3 covers code wrapping. It also shows how this can be done.

    Easiest way is to highlight your code, then press the # icon.

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Define variable range as named range
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2008, 09:28 AM
  2. Compare user input with range (with an if statement)
    By HBF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2008, 11:35 AM
  3. Copy an Auto Filtered Range
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-19-2008, 03:22 PM
  4. Delete specific rows, creating range and criteria using inputbox
    By gmccray in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2008, 02:00 PM
  5. Input range only and calculate Average of that range in another cell
    By Kokomo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-27-2007, 09:35 AM

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