ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   replace a number with a string from database (https://www.excelbanter.com/excel-programming/281736-replace-number-string-database.html)

K.Martens

replace a number with a string from database
 
I want to do the following:
I have in collumn "A" numbers from 1 to 60 and in Collumn "B" there
are corresponding names next to every number. This is my database.
Now i want to write a number between 1 and 60 in a cell in Collumn "D"
and in the cell next to it in collumn "E" shall come up the
corresponding text, which is defined in Column "a" and "B".

How do I write this macro?

IamN2Deep

replace a number with a string from database
 

I don't think you need a macro. A simple vlookup formula will work.

Place this formula in cell E1 and use cell D1 as your input cell.

=VLOOKUP(D1,A1:B60,2,FALSE)


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



All times are GMT +1. The time now is 06:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com