+ Reply to Thread
Results 1 to 15 of 15

Adv. Filter + Self Referencing in VBA

  1. #1
    Registered User
    Join Date
    11-08-2020
    Location
    FRANCE
    MS-Off Ver
    EXCEL PRO PLUS 2019
    Posts
    14

    Adv. Filter + Self Referencing in VBA

    Hello everyone,

    I hope you'll be able to help me with this advanced filter and Self Referencing problem.
    Everything is detailed in the attached pdf.
    I've also attached 2 example files showing the results of the Self Referencing before and after.

    Thank you in advance

    Best regards
    Attached Files Attached Files
    Last edited by MEDERIK; 03-24-2024 at 04:01 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,363

    Re: Adv. Filter + Self Referencing in VBA

    Please Login or Register  to view this content.

    Code below is sheets("Output")

    Please Login or Register  to view this content.
    Sample solution: Comments entered in "Output" are recorded in sheets "Comments".

    The macro uses "Code" as a "key" but this not sufficient as I note your example includes entries with same Company/Code/Country so a unique key is required in order the do the correct match with entries in "Comments"

    Macro executed for "Filter" button in "Data"
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    11-08-2020
    Location
    FRANCE
    MS-Off Ver
    EXCEL PRO PLUS 2019
    Posts
    14

    Re: Adv. Filter + Self Referencing in VBA

    Hello JohnTopley,


    In my personal file, I have a column with unique values, sorry I should have added it directly to my example file
    I'll test everything and come back with an answer
    Thank you very much for your invaluable help,
    I'll test your code on my personal file and come back as soon as I've finished.

    Many thanks

    Best regards

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,363

    Re: Adv. Filter + Self Referencing in VBA

    Thank you for the update.

  5. #5
    Registered User
    Join Date
    11-08-2020
    Location
    FRANCE
    MS-Off Ver
    EXCEL PRO PLUS 2019
    Posts
    14

    Re: Adv. Filter + Self Referencing in VBA

    Hello JohnTopley,
    I've tested your code and it's great in the example that I presented in my 1st message,
    But as indicated in my 2nd message, I actually have a column with unique values.
    I've adapted the example file with this new column
    The big question is, with a column of unique values, is it possible to avoid using a "Comments" sheet ?
    I uploaded a 3 pdf with the results of the tests I carried out.

    Can you please adapt your code to this new approach?
    The result in test 3.pdf is what I would have liked to see

    Thank you in advance

    Best regards
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,363

    Re: Adv. Filter + Self Referencing in VBA

    You have to keep the "Comments" somwhere so where do you want them?

  7. #7
    Registered User
    Join Date
    11-08-2020
    Location
    FRANCE
    MS-Off Ver
    EXCEL PRO PLUS 2019
    Posts
    14

    Re: Adv. Filter + Self Referencing in VBA

    If this is not possible in the "Output" sheet, then in "Comments"
    Best regarss

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,363

    Re: Adv. Filter + Self Referencing in VBA

    Where is the unique column in "Data"?

  9. #9
    Registered User
    Join Date
    11-08-2020
    Location
    FRANCE
    MS-Off Ver
    EXCEL PRO PLUS 2019
    Posts
    14

    Re: Adv. Filter + Self Referencing in VBA

    I've put unique values in the "Company" column,
    To simplify, I've put 1,2,3,4...etc

    Best regrds

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,363

    Re: Adv. Filter + Self Referencing in VBA

    Comments placed in "Output" (N:R) but in my opinion, they are better in a separate sheet.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-08-2020
    Location
    FRANCE
    MS-Off Ver
    EXCEL PRO PLUS 2019
    Posts
    14

    Re: Adv. Filter + Self Referencing in VBA

    Hello JohnTopley,
    You're great
    A huge thank you for this new request that I will test at the end of the day.
    Y
    ou are probably right about the comments in another sheet,
    Will I be able to use your 1st version or do I need a 3rd version for that ?

    Thanks in advance
    Best regards

  12. #12
    Registered User
    Join Date
    11-08-2020
    Location
    FRANCE
    MS-Off Ver
    EXCEL PRO PLUS 2019
    Posts
    14

    Re: Adv. Filter + Self Referencing in VBA

    JohnTopley,
    It's really impressive how well you've mastered VBA,
    The code is pure and superbly structured,
    I've tried to put the comments on the "Comments" sheet myself, but I can't do it.
    If you don't mind, could you please send me this new version
    Many thanks
    Best regards

    Thank you very much

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,363

    Re: Adv. Filter + Self Referencing in VBA

    See attached

    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    11-08-2020
    Location
    FRANCE
    MS-Off Ver
    EXCEL PRO PLUS 2019
    Posts
    14

    Re: Adv. Filter + Self Referencing in VBA

    I don't know how to thank you
    You're brilliant
    Many thanks again
    Have a nice evening

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,363

    Re: Adv. Filter + Self Referencing in VBA

    You're very welcome and thank you for the rep

+ 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. Replies: 2
    Last Post: 10-24-2021, 08:03 AM
  2. Filter Excel Table Without Referencing Table Name
    By xtinct2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-21-2021, 08:45 AM
  3. Change referencing these to referencing those by changing this.
    By bobmcgod in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2018, 08:51 AM
  4. Replies: 0
    Last Post: 01-09-2013, 06:58 AM
  5. Replies: 2
    Last Post: 06-03-2012, 03:33 PM
  6. Replies: 4
    Last Post: 08-30-2010, 12:10 AM
  7. Lookup referencing cell referencing range
    By cmcconnehey in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-15-2008, 06:19 PM

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