3 letter currency code to format cell

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,701
Office Version
  1. 365
Platform
  1. Windows
Hi,

I've got the following table of currencies and cell format codes:
PCT.xlsm
HIJKL
1CurrencyInputWith cell formattingCell format
2AUD1$1.00[$$-en-AU]#,##0.00
3CAD1$1.00[$$-en-CA]#,##0.00
4EUR1€1.00[$€-x-euro2]#,##0.00
5JPY1¥1.00[$¥-ja-JP]#,##0.00
6GBP1£1.00[$£-en-GB]#,##0.00
7NZD1$1.00[$$-en-NZ]#,##0.00
8USD1$1.00[$$-en-US]#,##0.00
Position Size Calculator

Everything above manually generated.

I wish to create a drop down list for the currencys and have the related format affect the green cell (look like formatting in blue column)
PCT.xlsm
HIJ
10Select CurrencyInput value
11
Position Size Calculator

How can this be achieved and if other currencies are added to the list, the correct cell formatting is applied? Later, the table above will be an Excel table to allow for dynamic rows

TIA,
Jack
 

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
11,998
Office Version
  1. 365
Platform
  1. Windows
You would need to use conditional formatting with a rule for each currency.

Given that most $ currencies use the same format, you could probably use 1 rule for all rather than one for each country.
 
Solution

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,701
Office Version
  1. 365
Platform
  1. Windows
Not a huge fan of CFs but you've inspired an idea...

Initially, created that table as part of posting this question but I can use it as a lookup table in via worksheet change event I'm already using.

Adding new currencies will be so infrequent that getting its related cell format code can be updated manually.

Not solved the way I initially wanted, but definitely resolves my issue! Thank you for the inspiration @jasonb75 :)
 

Watch MrExcel Video

Forum statistics

Threads
1,123,426
Messages
5,601,587
Members
414,460
Latest member
uctc

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
Top