VBA triggered by dropdown list

Mandy_84

Board Regular
Joined
May 29, 2017
Messages
71
Hi folks!
Is there anyone that can help with following please?
I have a dropdown list (data validation) in cell B21 that contains more than 10 items and I have a macro in the cell B22 that supposed to show figures depending on what has been chosen in B21. However below code doesn't work. What am I doing wrong?


1592317336827.png

and so on....


Thanks a ton!
 

Attachments

  • 1592317203289.png
    1592317203289.png
    54.2 KB · Views: 2

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Why not just put a formula in B22
=IF(B21="","",CHOOSE(RIGHT(B21,2)+0,2500,5100,6000,2000))
 
Upvote 0
it's just a dummy - in fact there are different text and figures and not just 10 options, hence if I can have all in one VBA code, would be perfect :)
 
Upvote 0
In that case can you please post your entire code. When posting code please use code tags the <vba/> icon in the reply window.
 
Upvote 0

Forum statistics

Threads
1,215,463
Messages
6,124,965
Members
449,201
Latest member
Jamil ahmed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top