Hi, desquaninc,
regarding your opening post
I need to know how to make excel look at a value in column A and based on what is there place the correct words in column D
This step might be resolved by using a Formula. Please enter this formula into E1 in your sample and then drag it down to the end of the data set:
The second step would be to use this string in a lookup formula to find the code and deliver the long name. Let´s assume this list is on a sheet named Data with the codes in Column A and the company name in Column B then please enter this formula into F1 on the sample (Sheet Data needs to be in the same workbook else needs to be "qualified" with the workbook´s name):
Drag down to the end of the data. (It´s this information that is missing in your workbook.)
These two steps can be put into one formula for D1 like
which isn´t that self-explanatory as the two steps before.
VBA:
This process can be automated via VBA to paste values instead of formulas. Assuming the table on sheet Data as before the code may look like
How to install your new code
- Copy the Excel VBA code
- Select the workbook in which you want to store the Excel VBA code
- Press Alt+F11 to open the Visual Basic Editor
- Choose Insert > Module
- Edit > Paste the macro into the module that appeared
- Close the VBEditor
- Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
To run the Excel VBA code:- Press Alt-F8 to open the macro list
- Select a macro in the list
- Click the Run button
You would need to save the workbook as macro enabled, set the settings in the options for the trusted locations (if not already done) and allow macros to be executed. You should try the macro on a copy (maybe copy the sheet inside the workbook for a test and clear column D there to see if the macro does what it is supposed to do).
HTH,
Holger
Bookmarks