macro/ lookup to enter codenumber for when text selected

rajesh84

New Member
Joined
Feb 18, 2010
Messages
29
Hi all,
Back after a long time.

I am trying to setup a drop down list in a cell (with about 25 entries in the look up) and when i select one of them I would like its corresponding code (reference) number to appear in a subsequest cell. For eg- if i select "asfdgehr" from the drop down list, the ref number 1234 should automatically come into another cell.At present i enter each text string,then i look up the corresponding number from a pdf file and then type it in. as you can imagine,pretty hard work !

thanks for your help.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi There,

You can use Vlookup to do that, VLOOKUP(your lookup value/text,the database were all the data is,the columns you wish to return, false)

Insure that the loop up value column in in the fist column on the left of the database.
 
Upvote 0
Thank you.The problem is that I dont actually know how to setup a macro with the vlookup running automatically so that when i select something in column 2,column 3 will get filled in automatically.in fact i have very little programming experience and I was hoping someone will show me a macro I can then modify if possible
 
Upvote 0
The Vlookup with change when you change the value.
Unless I am misunderstanding?
 
Upvote 0
sorry, i dont think i am being clear enough.

My table has 25 values with 25 corresponding code or reference value.

I tried a vlookup which works for 1 cell. for the next cell i have to go through the whole vlookup routine again .It is probably much easier for me to look up the value in a pdf file and enter it.

I am looking for a macro ro something which will run when i enter data into one cell and retrieve the required code and enter that into another cell and do the same thing in each of the 25 cells without me having to do the vlookup in each cell everytime. i dont know if this is possible or even if there is something else which will do the same thing.

thanks
 
Upvote 0
cool, I can write some code for you, and you send me the database location,the cells that you pupollate with the code, and where you what the lookups to populate, as well and the column of the infomation you would like to be returned.
 
Upvote 0
problem !

I cant seem to be able to paste the table or its image. so i will try an example

row 1 row2

abcd 1234
cdef 2345
fghi 6754
kjhg 7687

when I enter abcd, I would like 1234 to automatically come up in the next cell.
 
Upvote 0
HOPE IT WORKS!!

let say your data in sheet2 range(a1:b4)
Select 1st column till data exist Then give name to it ..let I gave NAMES
Select A column in sheet1
-->Data validation-->select List from drop down --> @ source =NAMES-->OK
IN sheet1 , b1 enter this formula
=IF(A1="","",VLOOKUP(A1,Sheet2!A1:B4,2,0))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,972
Members
448,537
Latest member
Et_Cetera

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top