+ Reply to Thread
Results 1 to 3 of 3

Great macro for filtering a unique list - some fine tuning

  1. #1
    Registered User
    Join Date
    06-22-2010
    Location
    Europe
    MS-Off Ver
    Excel 2003
    Posts
    4

    Great macro for filtering a unique list - some fine tuning

    Found this originally from
    http://www.freevbcode.com/ShowCode.asp?ID=4941

    I modified it a little bit to fill my own needs. So this code selects some range from column C to filter data and asks for the cell where to paste it.

    Please Login or Register  to view this content.
    Now I got these questions.

    1. Is there any code to keep my current formatting on the sheet. So that when the macro pastes the unique list, it wouldnt sweep my cell colors out?

    2. Actually I would like to use the macro so that I wouldn't need to take the headline row within the range. If I don't take it now, code duplicates the first value. (It is how advanced filter is built.) Is it easy for you to change the code little bit that it some how wouldn't take into account the first value? If not, forget this second question.
    e.g. This would be filtered as two, one, three.
    C5: one
    C6: two
    C7: one
    C8: two
    C9: three

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Great macro for filtering a unique list - some fine tuning

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Registered User
    Join Date
    06-22-2010
    Location
    Europe
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Great macro for filtering a unique list - some fine tuning

    I agree, it's a lot easier to understand with a file. Sorry for not putting it in the first place.

    So I want to filter a list to another place as unique and keep the destination place formatting like colors and heading. Added later: Also it would be nice if the destination column could be colored so, that after the last unique item there would be two light blue colored empty cells below it.

    The macro code comes with the file and I change the line to match the layout:
    Range("B3", Range("B65536")
    --> This way it doesn't work correctly, because it's duplicating the first value.
    --> You can change in the code B3 to B2. But then I have wrong heading name.

    Also the first way deletes some colors.

    Then the macro should first perhaps to empty the destination values, because it is not copying anything if there are values?
    EDIT: Actually just found a simple macro to clear cells to include in the code.
    Please Login or Register  to view this content.

    Still need help for the rest, thanks!
    Attached Files Attached Files
    Last edited by pekde; 06-24-2010 at 02:21 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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