+ Reply to Thread
Results 1 to 8 of 8

Lookup to find description and replace value typed in

  1. #1
    Registered User
    Join Date
    08-30-2020
    Location
    Miami
    MS-Off Ver
    365
    Posts
    5

    Lookup to find description and replace value typed in

    Good night,

    Raw Green Newby looking for help.

    Was assigned the task to create a VB script to do a lookup, but for the life of me the more I read how to do it the less I understand.


    I have two worksheets I have to be able to look up a value from the second worksheet.

    e.g. when a user types one of the below values on cell A1 I need it to look up on the second worksheet and replace it with the description.

    P = Personal
    I = Inventory
    S = Special

    Any help is greatly appreciated

    Thanks
    rudy.
    Last edited by AliGW; 09-20-2021 at 02:19 AM.

  2. #2
    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,929

    Re: Lookup help

    Why do you feel you need VBA for this? Sounds like a regular vlookup will work just fine?
    (or is this a homework assignment?)
    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

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: Lookup to find description and replace value typed in

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. I have done it fir you today.)
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    08-30-2020
    Location
    Miami
    MS-Off Ver
    365
    Posts
    5

    Re: Lookup to find description and replace value typed in

    Thank you for the clarification AliGW, my apologies for not reading the rules.

  5. #5
    Registered User
    Join Date
    08-30-2020
    Location
    Miami
    MS-Off Ver
    365
    Posts
    5

    Re: Lookup help

    Thank you FDibbins fo your reply,
    No this is not for homework. I was tasked to put together a spreadsheet for costing and wanted to classify each entry as to what the item is for. If I am not mistaken if I use a regular Vlookup in a formula I would have to use more than one cell (the input cell and a cell for the value). For this reason, I wanted the user to be able to enter the letter on the cell and the content be replaced with the description. because there will never be more than the three values I am trying to include in the script.

    e.g. User enters "S" in cell "A1" and the "S" is replaced with "Special Order" in the same cell.

    Thanks
    Rudy

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

    Re: Lookup to find description and replace value typed in

    I think you're missing a trick here.

    Once each of those entries are made, Excel's autofill will come into operation on subsequent rows.

    If you can set up a key at the top and have the three descriptions directly above the column where they will be, then typing the first letter of each will cause the full word to be offered.

    AliGW on MS365 Insider (Windows) 32 bit
    A
    B
    C
    D
    1
    2
    Key: P
    Personal
    3
    I
    Inventory
    4
    S
    Special
    5
    0000001
    20/09/2021
    Personal
    6
    0000002
    21/09/2021
    Inventory
    7
    0000003
    22/09/2021
    Special
    Sheet: Sheet1

    Select D8 in the attachment and type P, I or S and see what happens.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-30-2020
    Location
    Miami
    MS-Off Ver
    365
    Posts
    5

    Re: Lookup to find description and replace value typed in

    Thanks, I am aware of that option, but the way the spreadsheet is designed I wanted something a bit more sophisticated, and I thought it would be easy in excel, unfortunately, it seems what I want can not be done with excel. I will have to put something together in a database.

    Thanks for all your help and guidance.

    Rudy

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,728

    Re: Lookup to find description and replace value typed in

    It can be done - why have you drawn that conclusion? However, it will need VBA if my suggestion isn’t good enough for you. Shall I move the thread to the appropriate section?

+ 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. Replies: 25
    Last Post: 09-17-2020, 02:30 PM
  2. [SOLVED] Lookup: Lookup employee id and return value in cell x basued on most recent start date
    By jekeith in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-21-2018, 12:56 PM
  3. Two Lookup and Return (Lookup the column, then lookup the row)
    By Branbran10 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-05-2015, 04:55 PM
  4. Replies: 4
    Last Post: 05-19-2015, 08:42 PM
  5. Replies: 3
    Last Post: 04-08-2014, 03:11 AM
  6. Replies: 2
    Last Post: 05-19-2013, 08:46 AM
  7. Replies: 7
    Last Post: 06-19-2011, 12:51 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