+ Reply to Thread
Results 1 to 6 of 6

ClearContents and Clear not removing previous copied terms (from userforms)

  1. #1
    Registered User
    Join Date
    12-17-2009
    Location
    Boston, MA
    MS-Off Ver
    Excel 2002
    Posts
    15

    ClearContents and Clear not removing previous copied terms (from userforms)

    Hi all, I have am attempting to generate copied cells from two separate sheets, FINAL TABLE CATEGORY and FINAL TABLE COMPANY and I have three separate user forms I am working with that pull up different results in the RESULTS tab based on the user's selection. I have noticed however that I am getting old results as I go through each search, so for example if I search for "Alere" and then search for "3M" the Alere results will still show up. Here is some example code:

    Please Login or Register  to view this content.
    Essentially I am trying to get unique results by column E because that is where
    there is the most differentiation between the records. (Although I have tried uniquing between columns A through E with no success.)

    If someone can help me out with removing the previous results after a new search and making sure that all the variations for each company show up that would be beyond wonderful.


    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: ClearContents and Clear not removing previous copied terms (from userforms)

    Hi eurydice88
    you will need to do something like
    Please Login or Register  to view this content.
    to reset the results sheet filters before running the advanced filters again
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    12-17-2009
    Location
    Boston, MA
    MS-Off Ver
    Excel 2002
    Posts
    15

    Re: ClearContents and Clear not removing previous copied terms (from userforms)

    Hmm Thanks Pike, I just tried it in Userform4 but I wasn't having any success. By any chance did you test it and could post the workbook so I can see? I just keep getting run time errors and it doesn't seem to like the ShowAllData command after the UserForm Terminate field. .

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: ClearContents and Clear not removing previous copied terms (from userforms)

    Hi eurydice88
    It works in 2007xl
    But thats the problem you need to reset the results sheet before the next filter
    Try running the search then record a macro to clear the filter stop recording
    run the next seach and the data will be correct.

    place the recored marco in the form be for the new search

    hope that makes sence

  5. #5
    Registered User
    Join Date
    12-17-2009
    Location
    Boston, MA
    MS-Off Ver
    Excel 2002
    Posts
    15

    Re: ClearContents and Clear not removing previous copied terms (from userforms)

    I think I hear what you are saying but I just didn't know if there was something I could look at to test. In the beginning of the code it sets AutoFilter to off so maybe that should be edited, I am not sure. I actually have 2007 if you don't mind loading the workbook. Sorry I am one of those people that needs to learn by seeing first before anything sticks Thank you again for all your help, I remember you from before. Isn't it so sad I am working on the same project? Ugh.

  6. #6
    Registered User
    Join Date
    12-17-2009
    Location
    Boston, MA
    MS-Off Ver
    Excel 2002
    Posts
    15

    Re: ClearContents and Clear not removing previous copied terms (from userforms)

    Pike, thank you so much for everything you are right at work I am on version 2002. It is just one of those days...I also put up a new post because I think I am just going to try and remove duplicates instead of fuss around with autofilter since it seems to be causing more errors than anything else. What do you think?

+ 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