How to add a column of to the end of columns with value from table with VBA
I have the attached workbook.
I need help with the followings. the solution i need is via VBA, not formula.
on the Sheet("Data") at the end of column meaning the next available column, insert column returning Description from the table for the PRODUCT column. EE.xlsb
This does two VLOOKUP formulas, the first takes the whole of the product column and checks the lookup table for that value and returns the value from the second column of the lookup table; if the first VLOOKUP gives an error, it takes the first character of the product and adds "*" and then looks for that value in the lookup table.
With your data, there are two lines that give an error. They are both product code beginning with 1 which doesn't show in the lookup table.
Thanks
Rob
Flora Edwards
ASKER
Thanks Rob. appreciate your support. I needed this in VBA to automatically insert the value on the last available column.
Rob Henson
OK, sorry missed that. Is there a particular reason that you need VBA?
If you convert the data list to a Table, the formula will automatically get added to new entries.
Also noticed that the values starting with 2 that are not listed specifically default to "Bad Debts" because that is the first entry that starts with 2.
What result should the non-specific 2* products get?
=IFERROR(VLOOKUP(C2,'Looku
This does two VLOOKUP formulas, the first takes the whole of the product column and checks the lookup table for that value and returns the value from the second column of the lookup table; if the first VLOOKUP gives an error, it takes the first character of the product and adds "*" and then looks for that value in the lookup table.
With your data, there are two lines that give an error. They are both product code beginning with 1 which doesn't show in the lookup table.
Thanks
Rob