Forum Discussion
VBA IF STATEMENTS
- Aug 28, 2018
hia,
thanks for that. I've attached what I think solves your problem.
on sheet1 i've added 2 tables, one is called tbl_to and one is called tbl_from that contains the details of the accounts.
Then on your template i've added the index match for the various rows. If you change the names you should see the account details change.
Hi Philip
Please see attached.
hia,
thanks for that. I've attached what I think solves your problem.
on sheet1 i've added 2 tables, one is called tbl_to and one is called tbl_from that contains the details of the accounts.
Then on your template i've added the index match for the various rows. If you change the names you should see the account details change.
- BobOrrellAug 29, 2018Iron Contributor
Philip,
Your workbook works great. If I may offer two suggestions though. The drawback to the way your data validation dropdown is referenced, is that you have to manually update the reference each time you add a row normally, by pressing Tab from the bottom right cell of the table. You could create a named range using the table column, that you can then reference in the data validation which will not have to be updated. If you right click in the table, and select insert row, this isn't an issue, but one of the reasons I like tables, is that you can enter info and just keep tabbing to keep going on to the next row. I would also unlock the 2 dropdown cells, and protect the sheet. I've probably over-analyzed this, but it comes from having to un-break forms that I've created for others.
- Philip WestAug 29, 2018Iron Contributor
Hia Bob,
nope you are abolutly right, my normal preference is to use a table to hold the options and then use =indirect("tbl_name[column]") as the validation list.
I actually only added a validation list here because i made up the extra people in the example list and thought that it might help see the example work if i limited the options.
Also good idea about protecting the sheet, nothing worse then getting everything working and then someone acidently breaking everything right away :D
- LaToya PhillipAug 29, 2018Copper Contributor
Thank you so much Philip!!! You are the best!!! This worked perfectly!!!
- Philip WestAug 29, 2018Iron Contributor
Super! Here is a tutorial that explains how index match works:
https://www.deskbright.com/excel/using-index-match/
Its a pretty useful technique, well worth learning.