+ Reply to Thread
Results 1 to 8 of 8

Vlookup using beginning of string

  1. #1
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Vlookup using beginning of string

    Dear Excel experts,
    I have a file with data(worksheet “data”), in which there are 2 specific columns by name “From Position” & “To Position”, considering their text we require Location basis worksheet “reference table”
    result require considering text from "From Position" to "Location from" and text from "To Position" to "Location To" considering reference table

    For example (referring prefix and reference table )
    From Position Y-GTI-01C33E1 i.e. with prefix Y-GTI-0 Location will be Vessel/Yard
    From Position Y-GTI-BMCT i.e. with prefix Y-GTI-B Location will be BMCT
    Like wise..
    i have updated first two records manually in "Location from" and "Location To" for ready reference
    Kindly help
    Thanks in advance
    RavindraK
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,458

    Re: Vlookup using beginning of string

    In W2:
    Please Login or Register  to view this content.
    copy to X2 and down
    Quang PT

  3. #3
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Vlookup using beginning of string

    Thank you much Sir for very quick and appropriote revert/answer, this is really good , however, as we are having approx. 2 lacs of records in a file, can we have a macro /vba for the said process, which will be faster than formula.

    Kindly help, if possible.
    thanks a lot in advance.

    RavindraK

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,458

    Re: Vlookup using beginning of string

    Unfortunetaly I am not good at VBA. I'll call around for help.

  5. #5
    Registered User
    Join Date
    03-10-2021
    Location
    Paryzevo
    MS-Off Ver
    2k3
    Posts
    60

    Re: Vlookup using beginning of string

    Quote Originally Posted by RavindraK View Post
    ... from "From Position" to "Location from" and ... from "To Position" to "Location To"
    Maybe such a simple listing macro ?
    (due to firewall blockage the macro is in the txt file)
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Vlookup using beginning of string

    Thank you so much Sir, Macro is working exactly as expected, You are Really charm !!
    Can you please explain (annotations) this code for me, if possible.
    WBRegards
    RavindraK

  7. #7
    Registered User
    Join Date
    03-10-2021
    Location
    Paryzevo
    MS-Off Ver
    2k3
    Posts
    60

    Re: Vlookup using beginning of string

    Ad 1. Thank you for your kindness/courtesy but luckily I'm not: "Sir", "Seigneur", "Señor", "Von", "Yego Velichestvo" an so on ...

    Ad 2. "explain (annotations) this code" - see txt file


    Ps.:
    The macro can be simplified - see txt file Macro 2.txt
    Attached Files Attached Files
    Last edited by a2b1c1d1e1f1; 04-13-2021 at 05:21 PM.

  8. #8
    Forum Contributor
    Join Date
    07-19-2017
    Location
    Mumbai
    MS-Off Ver
    2013
    Posts
    305

    Re: Vlookup using beginning of string

    Thanks a lot . This is help me lot to fix my problem as well understand the macro script !!
    WBRegards
    RavindraK

+ 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] Removing beginning and end of a string.
    By sungen99 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2019, 11:59 AM
  2. [SOLVED] How to Add a String to the beginning of every value in a range
    By tvxl in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-05-2018, 04:02 PM
  3. [SOLVED] Add a string between beginning and and of a chain per corresponding code
    By percuk17 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-16-2017, 12:25 PM
  4. Replies: 5
    Last Post: 09-08-2010, 03:45 PM
  5. Replies: 3
    Last Post: 09-08-2010, 09:49 AM
  6. Add a string at the beginning and end
    By patyandra in forum Excel General
    Replies: 2
    Last Post: 12-05-2009, 07:05 PM
  7. [SOLVED] Is there away to add a zero to the beginning of number string?
    By Anthony in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-15-2006, 06:55 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