+ Reply to Thread
Results 1 to 7 of 7

Vlookup the first 9 letters

  1. #1
    Registered User
    Join Date
    12-17-2015
    Location
    Portland, OR
    MS-Off Ver
    Office 2010
    Posts
    26

    Vlookup the first 9 letters

    Is there a way to lookup only the first 9 letters in a range in VBA? Or, can I match a value that's in A60 of Sheet1 to a range in Sheet2 and omit the last word in the source cell "trainee" and find the 1st instance where that matches?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Vlookup the first 9 letters

    Hi,

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.

    To upload a file click the Go Advanced button at the foot of your post, look underneath the post area for the Manage Attachments section and take it from there.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-17-2015
    Location
    Portland, OR
    MS-Off Ver
    Office 2010
    Posts
    26

    Re: Vlookup the first 9 letters

    On attached workbook.
    If SHeet1 has a value in B4 the make C4 = EE_Nam. Then Vlookup A4 (as the source to find) but omit the letters "Trainee", so the source value would be "Make-Up Foreperson". Vlookup "Make-Up Foreperson" in the range SHeet2 Range("A:A"). Once found then count down 4 rows and insert a row and add the name there.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-17-2015
    Location
    Portland, OR
    MS-Off Ver
    Office 2010
    Posts
    26

    Re: Vlookup the first 9 letters

    Nevermind, I figured it out.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Vlookup the first 9 letters

    What was your "fix"? Care to share?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    12-17-2015
    Location
    Portland, OR
    MS-Off Ver
    Office 2010
    Posts
    26

    Re: Vlookup the first 9 letters

    Trainee_Position = Left(Trainee_Position, Len(Trainee_Position) - 8)

    I just omitted the last 8 characters then I could properly look up the correct value.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Vlookup the first 9 letters

    Thanks for sharing

+ 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. Formula that looks at 3 letters of information in a VLOOKUP
    By batexcel in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 06-10-2019, 09:40 AM
  2. [SOLVED] Vlookup first 3 letters and last 3 letters
    By makinmomb in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-19-2017, 03:44 PM
  3. Vlookup first 3 letters and last 3 letters
    By makinmomb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2017, 06:57 AM
  4. vlookup with mixed numbers and letters
    By rolex in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-16-2015, 08:28 AM
  5. VLookup on numbers and letters
    By cleetus in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-09-2013, 01:36 PM
  6. VLOOKUP changing RC to Column letters
    By lday75 in forum Excel General
    Replies: 3
    Last Post: 07-11-2012, 08:07 AM
  7. VLOOKUP with Numbers AND Letters
    By dkgolfer39 in forum Excel General
    Replies: 6
    Last Post: 07-23-2010, 01:05 PM

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