+ Reply to Thread
Results 1 to 4 of 4

Macro to filter data clearing issue

  1. #1
    Registered User
    Join Date
    07-03-2014
    Location
    Dublin, Ireland
    MS-Off Ver
    2007
    Posts
    20

    Macro to filter data clearing issue

    Hi folks,

    I have a macro set up to filter data based on two criteria. The user enters either 'Name' and/or 'Centre Name' to filter data located on another sheet. The 'Name' search works fine but when a 'Centre Name' is entered it clears the entire list of results. I have a 'Clear' button also to clear all the data for a fresh search but I can't see how they might be linked.

    If someone could help me to set up the filter properly I would really appreciate it. Sample file is attached.

    Many thanks.

    Simon.
    Attached Files Attached Files
    Last edited by kingsp; 09-28-2014 at 08:10 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Macro to filter data clearing issue

    On sheet "Data" the header for "Centre Name " (cell F1) has a trailing space at the end which is not an exact match for the header (G4) on the Search sheet.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    07-03-2014
    Location
    Dublin, Ireland
    MS-Off Ver
    2007
    Posts
    20

    Re: Macro to filter data clearing issue

    That was pretty silly of me. Many thanks AlphaFrog.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Macro to filter data clearing issue

    You're welcome.

+ 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. [SOLVED] Filter issue: data does not appear in filter box
    By Madmortagan68 in forum Excel General
    Replies: 2
    Last Post: 04-15-2013, 01:00 PM
  2. Issue clearing combobox on change
    By TonyFurioso in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-01-2013, 03:51 PM
  3. Clearing all data filters by macro
    By Andrew-Mark in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-17-2011, 09:58 PM
  4. Filter or sort data issue
    By seayakwc in forum Excel General
    Replies: 5
    Last Post: 11-05-2009, 09:08 AM
  5. Issue clearing previous selection
    By nmutimer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2006, 08:31 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