开发者

Drop down list selection Excel VBA

开发者 https://www.devze.com 2023-04-10 06:04 出处:网络
I want to populate a cell depending upon the drop down selection. How can i do it? The drop down list is created manually in the sheet.

I want to populate a cell depending upon the drop down selection. How can i do it? The drop down list is created manually in the sheet.

开发者_StackOverflow中文版EDIT: I have a column where every cell is a drop-drown. Depending upon what i select in the drop-down, the adjacent cell should get populated with a value.


Lets say you have a dropdown box in A1 allowing values 1,2, or 3, and you want B1 to show "A", "B", or "C" accordingly. Just type the formula

=IF(A1=1,"A",IF(A1=2,"B",IF(A1=3,"C","-")))

into B1. Of course, this works also when you have no dropdown box in A1.


Have a look on Vlookup and Index Match they are usually easier to create and mantain than nested If . If you need examples let me know

0

精彩评论

暂无评论...
验证码 换一张
取 消