+ Reply to Thread
Results 1 to 26 of 26

keyword Vlookup Macro

Hybrid View

makinmomb keyword Vlookup Macro 06-18-2023, 04:55 AM
AliGW Re: keyword Vlookup Macro 06-18-2023, 05:22 AM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 05:49 AM
AliGW Re: keyword Vlookup Macro 06-18-2023, 05:50 AM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 05:50 AM
AliGW Re: keyword Vlookup Macro 06-18-2023, 05:52 AM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 05:57 AM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 05:59 AM
AliGW Re: keyword Vlookup Macro 06-18-2023, 06:00 AM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 06:03 AM
AliGW Re: keyword Vlookup Macro 06-18-2023, 06:06 AM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 06:06 AM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 06:07 AM
AliGW Re: keyword Vlookup Macro 06-18-2023, 06:09 AM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 06:14 AM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 06:15 AM
AliGW Re: keyword Vlookup Macro 06-18-2023, 06:42 AM
JohnTopley Re: keyword Vlookup Macro 06-18-2023, 09:28 AM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 02:03 PM
AliGW Re: keyword Vlookup Macro 06-18-2023, 04:12 PM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 02:06 PM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 02:35 PM
TMS Re: keyword Vlookup Macro 06-18-2023, 05:18 PM
jindon Re: keyword Vlookup Macro 06-18-2023, 08:35 PM
makinmomb Re: keyword Vlookup Macro 06-18-2023, 11:59 PM
makinmomb Re: keyword Vlookup Macro 06-19-2023, 12:02 AM
  1. #1
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    keyword Vlookup Macro

    I want the quantities of E to go into C

    example 1

    GODOOWN DATES VIP
    VIP Dates 1084 ctn

    I want that 1084 to go into c1 while the text are different a1 has the word godown , not necessarily the descriptions are exact without the word GODOWN , i want the macro to do a keyword search than plug the quantities

    Look at these two that 1304 to go into from E to go into C2

    GODOWN ABLE FARM CONDENSED 380 G X 48
    ABle milk 380g 1304 ctn

    It is a check of computer vs physical , it takes sometime to do manually do this by reading

    See file attached
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,275

    Re: keyword Vlookup Macro

    Once again you have provided a workbook with NO mock-up showing what you are aiming for. How many times do we need to prompt you for a full and clear description and example workbook?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    Quantity of E into C while i gave example

    8545 the first one which reads Imperial soap Big 8545 ctn into into c 20 ( GODOWN IMPERIAL SOAP 200G )

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,275

    Re: keyword Vlookup Macro

    Put it into the workbook! SHOW us a few rows of example results! Please don't be lazy - you are expecting people to give of their time to help you, but can't be bothered to make it as easy for them as possible.

    This is why there are many who no longer offer you help.

  5. #5
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    Find two results i put on c2 by manually reading
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,275

    Re: keyword Vlookup Macro

    And how, exactly, does that relate to column E?

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    A
    B
    C
    1
    GODOOWN DATES VIP
    1084.00 CRT
    ????
    2
    GODOWN ABLE FARM CONDENSED 380 G X 48
    1304.00 CRT
    ????
    Sheet: Sheet1

  7. #7
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    Column E has the quantity but text joined , i need the macro to do the needful

    Column E is typed by a person reporting stock while Column A and B are computer generated
    Column E is a non computer guy he does not wona listen that in order for VLOOKUP to perform description must be exact

  8. #8
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    Column E is a non computer guy again does not know excel so he manually types a report for which we want to match if computer stock is matching computer stock and he is not aware of office quantities of B of each stock

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,275

    Re: keyword Vlookup Macro

    You still haven't SHOWN us what you want. What is supposed to match with what?

    Column E is a non computer guy he does not wona listen that in order for VLOOKUP to perform description must be exact
    That's insubordination. Sack him and hire someone more competent and biddable.

    Seriously, though - you still have not given us ANY examples in the workbook of any matches.

  10. #10
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    Computer E is a godown guy sitting at storage while , A and B are pulled from a system which allows export from another location

    The need be macro need to find the quantity which are at the end of the description and plug them at c column after finding a maximum key search

    HINT

    Ask the macro to remove the word GODOWN of column A and the perform the needful Special Vlookup

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,275

    Re: keyword Vlookup Macro

    So you are not going to show us what you want?

    I'm not fond of guessing games, so I'll leave it to someone with more patience. You are very frustrating in your unwillingness to SHOW us EXAMPLES of what you want.

    after finding a maximum key search
    This is what you are failing to demonstrate.

    Good luck.

  12. #12
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    Some one down there has under stood

    Africa Candles 190 ctn , take 190 from that put into C3 which reads GODOWN AFRICA CANDLES

  13. #13
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    ALIGW please wait there is someone who has understood and please wait for the needful results

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,275

    Re: keyword Vlookup Macro

    Ask the macro to remove the word GODOWN of column A and the perform the needful Special Vlookup
    That won't work. If it would, it would be easy.

    I'll leave you with this example: how do these items relate to each other and how would Excel know?

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    A
    B
    19
    GODOWN IMPERIAL 115GMS
    1250.00 CRT
    20
    GODOWN IMPERIAL SOAP 200G
    8565.00 CRT
    Sheet: Sheet1

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    E
    1
    Imperial soap Big 8545 ctn
    2
    Imperial soap Smoll 1250 ctn
    Sheet: Sheet1

    ALIGW please wait there is someone who has understood and please wait for the needful results
    PROVIDE SOME EXAMPLES!!! How hard can it be? You know what results you want, so show us some.

  15. #15
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    It will work , the macro guys here can do that ,
    they will ask the macro to pull the numeric from that text and
    write a code to do the keyword search , wait and just watch

  16. #16
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    Give this thread a silence and people will tackle this situation the logic is not too sophisticated

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,275

    Re: keyword Vlookup Macro

    Quote Originally Posted by makinmomb View Post
    Give this thread a silence and people will tackle this situation the logic is not too sophisticated
    Don't tell anyone here to stop responding. Provide the information they are asking for.

    It is for YOU to explain the logic you want used, it is NOT for your helpers to have to work it out.

    Again and again we have to prise the necessary information from you.

    It would have been very easy for you to provide some example results in your workbook, but you refuse to do so.

    It will work , the macro guys here can do that ,
    Of course they can, and it could probably be done with a formula, but it cannot be done without knowing the LOGIC that you are wanting Excel to apply.

    I see that you have chosen to ignore post #14 - is that because you can't work out the necessary logic?

  18. #18
    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
    30,963

    Re: keyword Vlookup Macro

    This is an issue of VERY "fuzzy" logic:

    GODOWN EURO GOLD 2.5 KG X 6
    GODOWN EURO GOLD 400 G X 24

    vs

    Euro milk 2500g 144 ctn
    Euro milk 400g 1914 ctn


    OR

    GODOWN LITTLE STEPS NO 2
    GODOWN LITTLE STEPS NO 3


    vs

    Little Sters Milk No .2. 30 ctn
    Little Sters Milk No .3. 30 ctn

    Mis-spellings adding to the problem!

    No easy macro solution!
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  19. #19
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    Where applicable , John , if it does not match some okay , at least if it can get me half the job done , i told ALIG someone understood she landing slapping me endlessly

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,275

    Re: keyword Vlookup Macro

    Quote Originally Posted by makinmomb View Post
    Where applicable , John , if it does not match some okay , at least if it can get me half the job done , i told ALIG someone understood she landing slapping me endlessly
    It's AliGW, NOT AliG, and John is telling you the same thing as I was: the logic is too fuzzy.

  21. #21
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    It can easily do this kind maybe

    GODOWN ARO PINK 377.00 CRT
    Aro pink 277 ctn

  22. #22
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    It can handle this one JOHN

    GODOWN EURO GOLD 400 G X 24 1914.00 CRT
    Euro milk 400g 1914 ctn

    Tell me why , you have EURO and 400 both common in that spelling variance , it should be able to do the needful

  23. #23
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,560

    Re: keyword Vlookup Macro

    I can’t seriously see anyone jumping in. Ali and John have explained the issues. BUT, just for fun, I thought I’d have a go.

    This formula replaces the first word (GODOWN, however it is spelt) in column A with nothing and then tries to MATCH what is left with column B. There are very few matches. As John said, there are mis-spellings, words in different order, things that may be meant to match but can't because different words are used and, I think, things that simply are not in the list.

    Formula: copy to clipboard
    =MATCH(REPLACE(A1,1,FIND(" ",A1,1),"")&"*",E:E,0)


    PHP Code: 
    DATES VIP    #N/A
    ABLE FARM CONDENSED 380 G X 48    #N/A
    AFRICA CANDLES    10
    AL MUDISH 2.5 KG X 6    
    #N/A
    ALDANAMAYA    17
    AONE RIM    
    #N/A
    ARO PINK    39
    CITRON LEMON    
    #N/A
    COVEX SOAP    40
    DISPOSABAL GLASS    
    #N/A
    DORCO BLADES CD    #N/A
    EURO GOLD 2.5 KG X 6    #N/A
    EURO GOLD 400 G X 24    #N/A
    FALCON FOIL BIG    22
    FALCON FOIL SMALL    
    #N/A
    GAUTAM RICE 8 X 5 KG    #N/A
    HASMAYA 450G X 20    #N/A
    HIT SPRAY 400ML    #N/A
    IMPERIAL 115GMS    #N/A
    IMPERIAL SOAP 200G    #N/A
    IVORY UKWAJU    4
    KASUKU MATCHBOX    
    #N/A
    LITTLE STEPS NO 2    #N/A
    LITTLE STEPS NO 3    #N/A
    MAGADI DATES    27
    MILK ALMO 25KG    
    #N/A
    MO EXCELLENCE SQUARE LINE    #N/A
    MO SIMBA BATTERY BIG    #N/A
    MO SIMBA BATTERY SMALL    #N/A
    SAF INSTANT 500G X20    #N/A
    SAF INSTANT SATCHET 30 X 12 X 11G    #N/A
    SUGAR KILOMBERO 1 X 20    #N/A
    TIGER BATTERY BIG    #N/A
    TIGER CANDLES    #N/A 
    The first entry, DATES VIP, will not match VIP Dates. Note, words swapped over and two spaces.

    If you want consistent Data Entry, you should use Data Validation, not try to clean the mess up afterwards.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


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

    Re: keyword Vlookup Macro

    Not 100%, but some of your results are really strange.
    Sub test()
        Dim a(1), b, x, i As Long
        x = Range("a1", Range("a" & Rows.Count).End(xlUp)).Address
        a(0) = Evaluate("index(replace(trim(" & x & "),1,find("" ""," & x & "),""""),,)")
        ReDim b(1 To UBound(a(0), 1), 1 To 1)
        a(1) = Range("e1", Range("e" & Rows.Count).End(xlUp)).Resize(, 2)
        With CreateObject("VBScript.RegExp")
            For i = 1 To UBound(a(1), 1)
                a(1)(i, 2) = ""
                .Pattern = " *(\d+) *(ctn|bags?)$"
                If .test(a(1)(i, 1)) Then a(1)(i, 2) = .Execute(a(1)(i, 1))(0).submatches(0) & " CRT"
                a(1)(i, 1) = .Replace(a(1)(i, 1), "")
                .Pattern = "(\d)(\D)"
                a(1)(i, 1) = Application.Trim(.Replace(a(1)(i, 1), "$1 $2"))
            Next
        End With
        For i = 1 To UBound(a(0), 1)
            b(i, 1) = VLookLike(a(0)(i, 1), a(1))
        Next
        [c1].Resize(UBound(b, 1)) = b
    End Sub
    
    Function VLookLike(s, a) As String
        Dim i As Long, ii As Long, x(2), b(), n As Long, flg As Boolean
        x(0) = Split("^" & Replace(Application.Trim(s), " ", "^ ^") & "^")
        For i = 1 To UBound(a, 1)
            'If i = 28 Then Stop
            If UCase$(s) = UCase(Application.Trim(a(i, 1))) Then
                VLookLike = a(i, 2): Exit Function
            End If
            x(1) = Split("^" & Replace(Application.Trim(a(i, 1)), " ", "^ ^") & "^")
            For ii = 0 To UBound(x(0))
                x(1) = Filter(x(1), x(0)(ii), False, 1)
                If UBound(x(1)) = -1 Then VLookLike = a(i, 2): flg = True: Exit For
            Next
            If Not flg Then
                x(2) = UBound(Split("^" & Replace(Application.Trim(a(i, 1)), " ", "^ ^") & "^")) - UBound(x(1))
                If x(2) Then
                    n = n + 1: ReDim Preserve b(1 To 2, 1 To n): b(2, n) = a(i, 2): b(1, n) = x(2)
                End If
            Else
                Exit For
            End If
            flg = False
        Next
        If Not flg Then
            If n Then
                x(0) = Application.Max(Application.Index(b, 1, 0))
                VLookLike = b(2, Application.Match(x(0), Application.Index(b, 1, 0), 0))
            End If
        End If
    End Function
    Last edited by jindon; 06-18-2023 at 09:23 PM.

  25. #25
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    Thank you Jondon for doing the impossible possible ,
    Last edited by AliGW; 06-19-2023 at 01:20 AM. Reason: Unnecessary dig at forum member removed - do NOT make personal attacks. Read the forum rules.

  26. #26
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,720

    Re: keyword Vlookup Macro

    When running the macro i will rename Richoos Disposable to Disposable Glass so it runs the only missing , thank you again Jindon

+ 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. Search cells C1:C3000 for keyword and if exists place a keyword in A1:A3000
    By GregQuick in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-24-2015, 07:38 PM
  2. Replies: 6
    Last Post: 03-18-2014, 11:16 AM
  3. Filter List by Keyword & copy the result in column by keyword as header
    By kitunga in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2013, 07:16 AM
  4. [SOLVED] Need to chck if a keyword is present in a text string and return keyword if yes
    By Jekaterina in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-16-2012, 05:55 PM
  5. Keyword matching and multiple VLOOKUP
    By makingtrails in forum Excel General
    Replies: 4
    Last Post: 12-07-2012, 10:57 AM
  6. Replies: 2
    Last Post: 07-13-2012, 04:02 AM
  7. Replies: 1
    Last Post: 12-27-2010, 08:53 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