+ Reply to Thread
Results 1 to 9 of 9

Transform User Defined Function to Sub (Filter Partial Concatenated Match) SOS

  1. #1
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    Transform User Defined Function to Sub (Filter Partial Concatenated Match) SOS

    Hello,

    I'm running in circles. I've built this dashboard over a bunch of concatenated SKU placed in column. Each string vary the number of substrings, but every code has 34 lenght. A great human being also from this community helped me with this user defined function below. The code does exactly what I need: it loops through column "P" (SKUs) and search for partial matches within each code for every partial code that is referenced in another column.

    For instance, in this other column I have the partial codes: "005P" 039P" 0154P"

    The code will search for these 3 values within every substring of each cell of column "P", and then will return into another column ("M") the same array but showing only the match cases instead.


    So if I had:
    Please Login or Register  to view this content.
    It'd only return
    Please Login or Register  to view this content.

    The script would be perfect if it didn't consume too much processing. The file became useless because it takes too long to update. I've tried everything I could think of, I simplified the formulas, switched every vlookup for index, tried to be the less redundant as possible, but it's still too slow.

    The way it is right now, I have these listboxes that will trigger a true/false statement that populates the reference column for the partial codes. The listboxes are set to trigger manual calculation as a band-aid, and when the user is done selecting the filters he presses a "update button" that turn calculation back to automatic. This band-aid is due to the fact that I assumed a conflict was happening when clicking the listbox and the user function would update at the same time the column is being populated.
    My guess is that using a sub code could be more efficient and maybe save me sometime. Right now it takes about 15-20 min to update every time. If I could take it down to 5 min I'd be glad already.

    Anyone has an opinion on this?

    Please Login or Register  to view this content.
    Last edited by therealdees; 05-10-2021 at 11:24 AM.
    Pedro.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Transform User Defined Function to Sub (Filter Partial Concatenated Match) SOS

    Untested,
    If it doesn't work, upload your workbook.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    Re: Transform User Defined Function to Sub (Filter Partial Concatenated Match) SOS

    Hey Jindon, I tried the code and it stuck more than 10 min so I restarted excel. I made some changes tho, not sure if that could be the problem.

    As the button is located in a different sheet from the output column for the results, I added
    Please Login or Register  to view this content.

    I thought it'd be the way, sorry if it looks stupid


    And 1 question, where does the code makes reference to column "m" as output result?

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Transform User Defined Function to Sub (Filter Partial Concatenated Match) SOS

    Is it working or not?
    Is it still slow?
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    Re: Transform User Defined Function to Sub (Filter Partial Concatenated Match) SOS

    it didn't work, or at least for the 10 min waited. I think I'll try some things with the user function as I managed to get some improvement after I did this post

    Thank you very much for your interest and help, sorry if I made you waste your time, but I will keep this code to further testing in the future

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Transform User Defined Function to Sub (Filter Partial Concatenated Match) SOS

    Then upload a workbook,

    I tested with 10000 rows and took 2 sec.

  7. #7
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    Re: Transform User Defined Function to Sub (Filter Partial Concatenated Match) SOS

    I will upload. Just let me rush on some things I need to fix and remove sensitive data and I will come back soon with a file.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Transform User Defined Function to Sub (Filter Partial Concatenated Match) SOS

    Seems you are happy with the other thread, so no need to upload a file, I'm out.

  9. #9
    Forum Contributor
    Join Date
    01-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365
    Posts
    263

    Re: Transform User Defined Function to Sub (Filter Partial Concatenated Match) SOS

    Yes, for some for reason after I made some changes it works well now.

    Thank you very much jindon, your code still useful and I kept it for any future needs

+ 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] User Defined function for comparing 2 array and return approximate match
    By menonarun in forum Excel - New Users/Basics
    Replies: 9
    Last Post: 05-13-2018, 01:09 AM
  2. User defined MATCH-INDEX function in VBA
    By SymMacro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2016, 05:44 PM
  3. Replies: 1
    Last Post: 07-19-2014, 06:29 AM
  4. [SOLVED] User Defined Function To Add A Zero In A Concatenated Formula
    By BanburyS in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-29-2012, 02:23 AM
  5. How to write user defined function for Index and Match
    By spybug in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2012, 05:20 AM
  6. Creating a deeply nested IF MATCH user defined function
    By rrbest in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2011, 01:23 PM
  7. User Defined Function using Sumifs, Offset, Match and CountA
    By PeterW2020 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-29-2011, 02:29 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