Can I change the formatting of a cell (currency) based on a different cell?

AbrahamGluck

Board Regular
Joined
Apr 12, 2016
Messages
129
Office Version
  1. 365
Platform
  1. Windows
Is there any way for the display formatting to be changed automatically dependent on whether ISO code I write?

[TABLE="class: grid, width: 148"]
<tbody>[TR]
[TD="align: left"]ALL[/TD]
[TD="align: left"]Lek[/TD]
[/TR]
[TR]
[TD="align: left"]AFN[/TD]
[TD="align: right"]؋[/TD]
[/TR]
[TR]
[TD="align: left"]ARS[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]AWG[/TD]
[TD="align: left"]ƒ[/TD]
[/TR]
[TR]
[TD="align: left"]AUD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]AZN[/TD]
[TD="align: left"]₼[/TD]
[/TR]
[TR]
[TD="align: left"]BSD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]BBD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]BYR[/TD]
[TD="align: left"]p.[/TD]
[/TR]
[TR]
[TD="align: left"]BZD[/TD]
[TD="align: left"]BZ$[/TD]
[/TR]
[TR]
[TD="align: left"]BMD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]BOB[/TD]
[TD="align: left"]$b[/TD]
[/TR]
[TR]
[TD="align: left"]BAM[/TD]
[TD="align: left"]KM[/TD]
[/TR]
[TR]
[TD="align: left"]BWP[/TD]
[TD="align: left"]P[/TD]
[/TR]
[TR]
[TD="align: left"]BGN[/TD]
[TD="align: left"]лв[/TD]
[/TR]
[TR]
[TD="align: left"]BRL[/TD]
[TD="align: left"]R$[/TD]
[/TR]
[TR]
[TD="align: left"]BND[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]KHR[/TD]
[TD="align: left"]៛[/TD]
[/TR]
[TR]
[TD="align: left"]CAD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]KYD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]CLP[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]CNY[/TD]
[TD="align: left"]¥[/TD]
[/TR]
[TR]
[TD="align: left"]COP[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]CRC[/TD]
[TD="align: left"]₡[/TD]
[/TR]
[TR]
[TD="align: left"]HRK[/TD]
[TD="align: left"]kn[/TD]
[/TR]
[TR]
[TD="align: left"]CUP[/TD]
[TD="align: left"]₱[/TD]
[/TR]
[TR]
[TD="align: left"]CZK[/TD]
[TD="align: left"]Kč[/TD]
[/TR]
[TR]
[TD="align: left"]DKK[/TD]
[TD="align: left"]kr[/TD]
[/TR]
[TR]
[TD="align: left"]DOP[/TD]
[TD="align: left"]RD$[/TD]
[/TR]
[TR]
[TD="align: left"]XCD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]EGP[/TD]
[TD="align: left"]£[/TD]
[/TR]
[TR]
[TD="align: left"]SVC[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]EEK[/TD]
[TD="align: left"]kr[/TD]
[/TR]
[TR]
[TD="align: left"]EUR[/TD]
[TD="align: left"]€[/TD]
[/TR]
[TR]
[TD="align: left"]FKP[/TD]
[TD="align: left"]£[/TD]
[/TR]
[TR]
[TD="align: left"]FJD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]GEL[/TD]
[TD="align: left"]₾[/TD]
[/TR]
[TR]
[TD="align: left"]GHC[/TD]
[TD="align: left"]¢[/TD]
[/TR]
[TR]
[TD="align: left"]GIP[/TD]
[TD="align: left"]£[/TD]
[/TR]
[TR]
[TD="align: left"]GTQ[/TD]
[TD="align: left"]Q[/TD]
[/TR]
[TR]
[TD="align: left"]GGP[/TD]
[TD="align: left"]£[/TD]
[/TR]
[TR]
[TD="align: left"]GYD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]HNL[/TD]
[TD="align: left"]L[/TD]
[/TR]
[TR]
[TD="align: left"]HKD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]HUF[/TD]
[TD="align: left"]Ft[/TD]
[/TR]
[TR]
[TD="align: left"]ISK[/TD]
[TD="align: left"]kr[/TD]
[/TR]
[TR]
[TD="align: left"]INR[/TD]
[TD="align: left"]₹[/TD]
[/TR]
[TR]
[TD="align: left"]IDR[/TD]
[TD="align: left"]Rp[/TD]
[/TR]
[TR]
[TD="align: left"]IRR[/TD]
[TD="align: right"]﷼[/TD]
[/TR]
[TR]
[TD="align: left"]IMP[/TD]
[TD="align: left"]£[/TD]
[/TR]
[TR]
[TD="align: left"]ILS[/TD]
[TD="align: left"]₪[/TD]
[/TR]
[TR]
[TD="align: left"]JMD[/TD]
[TD="align: left"]J$[/TD]
[/TR]
[TR]
[TD="align: left"]JPY[/TD]
[TD="align: left"]¥[/TD]
[/TR]
[TR]
[TD="align: left"]JEP[/TD]
[TD="align: left"]£[/TD]
[/TR]
[TR]
[TD="align: left"]KZT[/TD]
[TD="align: left"]лв[/TD]
[/TR]
[TR]
[TD="align: left"]KPW[/TD]
[TD="align: left"]₩[/TD]
[/TR]
[TR]
[TD="align: left"]KRW[/TD]
[TD="align: left"]₩[/TD]
[/TR]
[TR]
[TD="align: left"]KGS[/TD]
[TD="align: left"]лв[/TD]
[/TR]
[TR]
[TD="align: left"]LAK[/TD]
[TD="align: left"]₭[/TD]
[/TR]
[TR]
[TD="align: left"]LVL[/TD]
[TD="align: left"]Ls[/TD]
[/TR]
[TR]
[TD="align: left"]LBP[/TD]
[TD="align: left"]£[/TD]
[/TR]
[TR]
[TD="align: left"]LRD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]LTL[/TD]
[TD="align: left"]Lt[/TD]
[/TR]
[TR]
[TD="align: left"]MKD[/TD]
[TD="align: left"]ден[/TD]
[/TR]
[TR]
[TD="align: left"]MYR[/TD]
[TD="align: left"]RM[/TD]
[/TR]
[TR]
[TD="align: left"]MUR[/TD]
[TD="align: left"]₨[/TD]
[/TR]
[TR]
[TD="align: left"]MXN[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]MNT[/TD]
[TD="align: left"]₮[/TD]
[/TR]
[TR]
[TD="align: left"]MZN[/TD]
[TD="align: left"]MT[/TD]
[/TR]
[TR]
[TD="align: left"]NAD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]NPR[/TD]
[TD="align: left"]₨[/TD]
[/TR]
[TR]
[TD="align: left"]ANG[/TD]
[TD="align: left"]ƒ[/TD]
[/TR]
[TR]
[TD="align: left"]NZD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]NIO[/TD]
[TD="align: left"]C$[/TD]
[/TR]
[TR]
[TD="align: left"]NGN[/TD]
[TD="align: left"]₦[/TD]
[/TR]
[TR]
[TD="align: left"]NOK[/TD]
[TD="align: left"]kr[/TD]
[/TR]
[TR]
[TD="align: left"]OMR[/TD]
[TD="align: right"]﷼[/TD]
[/TR]
[TR]
[TD="align: left"]PKR[/TD]
[TD="align: left"]₨[/TD]
[/TR]
[TR]
[TD="align: left"]PAB[/TD]
[TD="align: left"]B/.[/TD]
[/TR]
[TR]
[TD="align: left"]PYG[/TD]
[TD="align: left"]Gs[/TD]
[/TR]
[TR]
[TD="align: left"]PEN[/TD]
[TD="align: left"]S/.[/TD]
[/TR]
[TR]
[TD="align: left"]PHP[/TD]
[TD="align: left"]₱[/TD]
[/TR]
[TR]
[TD="align: left"]PLN[/TD]
[TD="align: left"]zł[/TD]
[/TR]
[TR]
[TD="align: left"]QAR[/TD]
[TD="align: right"]﷼[/TD]
[/TR]
[TR]
[TD="align: left"]RON[/TD]
[TD="align: left"]lei[/TD]
[/TR]
[TR]
[TD="align: left"]RUB[/TD]
[TD="align: left"]₽[/TD]
[/TR]
[TR]
[TD="align: left"]SHP[/TD]
[TD="align: left"]£[/TD]
[/TR]
[TR]
[TD="align: left"]SAR[/TD]
[TD="align: right"]﷼[/TD]
[/TR]
[TR]
[TD="align: left"]RSD[/TD]
[TD="align: left"]Дин.[/TD]
[/TR]
[TR]
[TD="align: left"]SCR[/TD]
[TD="align: left"]₨[/TD]
[/TR]
[TR]
[TD="align: left"]SGD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]SBD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]SOS[/TD]
[TD="align: left"]S[/TD]
[/TR]
[TR]
[TD="align: left"]ZAR[/TD]
[TD="align: left"]S[/TD]
[/TR]
[TR]
[TD="align: left"]LKR[/TD]
[TD="align: left"]₨[/TD]
[/TR]
[TR]
[TD="align: left"]SEK[/TD]
[TD="align: left"]kr[/TD]
[/TR]
[TR]
[TD="align: left"]CHF[/TD]
[TD="align: left"]CHF[/TD]
[/TR]
[TR]
[TD="align: left"]SRD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]SYP[/TD]
[TD="align: left"]£[/TD]
[/TR]
[TR]
[TD="align: left"]TWD[/TD]
[TD="align: left"]NT$[/TD]
[/TR]
[TR]
[TD="align: left"]THB[/TD]
[TD="align: left"]฿[/TD]
[/TR]
[TR]
[TD="align: left"]TTD[/TD]
[TD="align: left"]TT$[/TD]
[/TR]
[TR]
[TD="align: left"]TRL[/TD]
[TD="align: left"]₺[/TD]
[/TR]
[TR]
[TD="align: left"]TVD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]UAH[/TD]
[TD="align: left"]₴[/TD]
[/TR]
[TR]
[TD="align: left"]GBP[/TD]
[TD="align: left"]£[/TD]
[/TR]
[TR]
[TD="align: left"]USD[/TD]
[TD="align: left"]$[/TD]
[/TR]
[TR]
[TD="align: left"]UYU[/TD]
[TD="align: left"]$U[/TD]
[/TR]
[TR]
[TD="align: left"]UZS[/TD]
[TD="align: left"]лв[/TD]
[/TR]
[TR]
[TD="align: left"]VEF[/TD]
[TD="align: left"]Bs[/TD]
[/TR]
[TR]
[TD="align: left"]VND[/TD]
[TD="align: left"]₫[/TD]
[/TR]
[TR]
[TD="align: left"]YER[/TD]
[TD="align: right"]﷼[/TD]
[/TR]
[TR]
[TD="align: left"]ZWD[/TD]
[TD="align: left"]Z$[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
First I would declare all of the formatting rules for each type using:

Range.NumberFormat Property (Excel)
https://msdn.microsoft.com/en-us/library/office/ff196401.aspx

Then I would make a VBA macro that uses a "select case" statement on the cell that defines the format for the range of cells you want to format

Code:
Select Case Range("A1").Text[INDENT]Case "ALL"[/INDENT]
[INDENT=2]Worksheets("Sheet1").Columns("C").NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
[/INDENT]
[INDENT]...
[/INDENT]
 End Select

Finally,
I would make a trigger that runs this macro whenever the value of the defining cell is changed using a technique like this:

https://support.microsoft.com/en-us/kb/213612


That should be all the tools you need to get there. Good luck!
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

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