+ Reply to Thread
Results 1 to 12 of 12

Reading the last 2 letters in a combobox value and enter those 2 letters into column

  1. #1
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Reading the last 2 letters in a combobox value and enter those 2 letters into column

    Hello.

    below is a list of items that populate a combo box. I need to find a way to read the text at the end of each entry.
    For example. if the user selects "packaging line 05A - MV" I want code to recognize that "MV" is at the end and put "MV" in a column by itself when the entry is added to the spreadsheet. This list is going to be added to and deleted from so i'm unable to reference specific values.



    74 Slitter - MV
    76 Slitter - MV
    63 Slitter - MV
    38 Slitter - MV
    Packaging Line 05A - MV
    Packaging Line 05B - MV
    30 ton Shawbox (North Bay E) - MV
    30 ton Shepard Niles (North Bay W) - MV
    30 ton Northern (Middle Bay W) - MV
    25 ton Milwaukee (Middle Bay E) - MV
    38 Jib Crane (South Bay E) - MV
    30 ton Northern (South Bay W) - MV
    40 ton Whiting (West Bay N) - MV
    40 ton Whiting (West Bay S) - MV
    40 ton Morgan (East Bay N) - MV
    40 ton Morgan (East Bay S) - MV
    72 Slitter - GR
    54 Slitter - GR
    30 Slitter - GR
    Yale Hi-Lo #1 - GR
    Yale Hi-Lo #2 - GR
    30 ton Shawbox - GR
    20 ton Conco - GR
    25 ton P&H - GR
    10 ton Shawbox - GR
    5 ton 30'' crane - GR
    77 Slitter - BH
    64 Slitter - BH
    R&M 25 ton Rail - BH
    P&H 25 ton - BH
    P&H 30 ton - BH
    Abel-Howel 20 ton - BH
    Whiting 30 ton - BH
    Kone Crane 5 ton - BH
    R&M 6 ton - BH
    155 Hyster #1 - BH
    155 Hyster #2 - BH
    Fortif 155 Hyster - BH
    Hyster 120 Boxcar #1 - BH
    Hyster 120 Boxcar #2 - BH
    Hyster 120 #1 - BH
    Hyster 120 # 2 - BH

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    Is Kone Crane 5 ton - BH one word?

  3. #3
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    I'm not sure what you mean. That is all in one cell?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    Yes.. You can just use
    Please Login or Register  to view this content.
    ?

  5. #5
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    okay.. im not sure where exactly to put that in my code:

    this is what i'm using to add the values to the spreadsheet

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    okay.. im not sure where exactly to put that in my code:

    this is what i'm using to add the values to the spreadsheet

    Please Login or Register  to view this content.

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    AFAIS, what you looking for is Repairtb1.Text

    Or upload example workbook. make sure to remove all private informations.

  8. #8
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    no, I am looking for whats inputing into column D :

    'Adds Location
    cells(rownum,"D") = (equipmentcb1.value, 2 )


    but I have attached the workbook.
    its under construction right now because im just now incorporating this into an already finished workbook

    the password, whenever prompted, is "steel123"
    Attached Files Attached Files

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    I'm getting error...

    This doesn't work for you?

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    oh I forgot the right.
    what does the right do? does it mean start from the right side and read left?

  11. #11
    Forum Contributor
    Join Date
    05-20-2013
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2010
    Posts
    255

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    It works. Thank you!

  12. #12
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Reading the last 2 letters in a combobox value and enter those 2 letters into column

    Yes... Number (2 in your case) of characters on the right...

    So Right(emilyloz, 3) will return loz

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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